From 56469d1c5c5229c08e93838b78371423f0a7c3b2 Mon Sep 17 00:00:00 2001
From: Ishu Singhal <57007764+Issue-03@users.noreply.github.com>
Date: Thu, 3 Sep 2020 19:58:35 +0530
Subject: [PATCH] fix(learn): update tests to allow more valid solutions
(#39054)
* fix(curriculum): updated tests: fixed #39049
It won't pass something like this now:
const myConcat = () => {};
console.log(3);
* fix: add suggested change
Co-authored-by: moT01 <20648924+moT01@users.noreply.github.com>
---
.../es6/write-arrow-functions-with-parameters.english.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-arrow-functions-with-parameters.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-arrow-functions-with-parameters.english.md
index fa4132f5a7..538ffd9666 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-arrow-functions-with-parameters.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/write-arrow-functions-with-parameters.english.md
@@ -45,10 +45,10 @@ tests:
testString: getUserInput => assert(!getUserInput('index').match(/var/g));
- text: myConcat
should be a constant variable (by using const
).
testString: getUserInput => assert(getUserInput('index').match(/const\s+myConcat/g));
- - text: myConcat
should be a function.
- testString: assert(typeof myConcat === 'function');
+ - text: myConcat
should be an arrow function with two parameters
+ testString: assert(/myConcat=\(\w+,\w+\)=>/.test(code.replace(/\s/g, '')) && typeof myConcat === 'function');
- text: myConcat()
should return [1, 2, 3, 4, 5]
.
- testString: assert(() => { const a = myConcat([1], [2]); return a[0] == 1 && a[1] == 2; });
+ testString: assert.deepEqual(myConcat([1, 2], [3, 4, 5]), [1, 2, 3, 4, 5]);
- text: function
keyword should not be used.
testString: getUserInput => assert(!getUserInput('index').match(/function/g));