From 8a24fbfac94dc5d446d51768eaa062637a6c1a16 Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Fri, 14 May 2021 09:56:18 +0200 Subject: [PATCH] Adding more details on how to run the playground code to address the issue #705. --- src/playground/__test__/playground.test.js | 7 +++++-- src/playground/playground.js | 13 ++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/playground/__test__/playground.test.js b/src/playground/__test__/playground.test.js index 501a87a72..84a3e8301 100644 --- a/src/playground/__test__/playground.test.js +++ b/src/playground/__test__/playground.test.js @@ -1,5 +1,8 @@ +import playground from '../playground'; + describe('playground', () => { - it('should perform playground tasks', () => { - // Place your playground tests here. + it('should return correct results', () => { + // Replace the next dummy test with your playground function tests. + expect(playground()).toBe(120); }); }); diff --git a/src/playground/playground.js b/src/playground/playground.js index 7872c9e3b..b8c5b210b 100644 --- a/src/playground/playground.js +++ b/src/playground/playground.js @@ -1 +1,12 @@ -// Place your playground code here. +// Import any algorithmic dependencies you need for your playground code here. +import factorial from '../algorithms/math/factorial/factorial'; + +// Write your playground code inside the playground() function. +// Test your code from __tests__/playground.test.js +// Launch playground tests by running: npm test -- 'playground' +function playground() { + // Replace the next line with your playground code. + return factorial(5); +} + +export default playground;