From a326c2cf9a914741a2661280d05f5939d872ebb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F?= Date: Mon, 1 Apr 2019 11:55:43 +0300 Subject: [PATCH] Make a comparison in the test more accurately (#35500) * Update use-arrow-functions-to-write-concise-anonymous-functions.english.md * refactor: fix the assert messages to make them more like all the rest in the curriculum (i.e. using `should`) Co-Authored-By: iliyaZelenko --- ...rite-concise-anonymous-functions.english.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-arrow-functions-to-write-concise-anonymous-functions.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-arrow-functions-to-write-concise-anonymous-functions.english.md index 46bdf11905..33f501d582 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-arrow-functions-to-write-concise-anonymous-functions.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-arrow-functions-to-write-concise-anonymous-functions.english.md @@ -26,16 +26,16 @@ Rewrite the function assigned to the variable magic which returns a ```yml tests: - - text: User did replace var keyword. - testString: getUserInput => assert(!getUserInput('index').match(/var/g), 'User did replace var keyword.'); + - text: User should replace var keyword. + testString: getUserInput => assert(!getUserInput('index').match(/var/g)); - text: magic should be a constant variable (by using const). - testString: getUserInput => assert(getUserInput('index').match(/const\s+magic/g), 'magic should be a constant variable (by using const).'); - - text: magic is a function. - testString: assert(typeof magic === 'function', 'magic is a function.'); - - text: magic() returns correct date. - testString: assert(magic().getDate() == new Date().getDate(), 'magic() returns correct date.'); - - text: function keyword was not used. - testString: getUserInput => assert(!getUserInput('index').match(/function/g), 'function keyword was not used.'); + testString: getUserInput => assert(getUserInput('index').match(/const\s+magic/g)); + - text: magic should be a function. + testString: assert(typeof magic === 'function'); + - text: magic() should return correct date. + testString: assert(magic().setHours(0,0,0,0) === new Date().setHours(0,0,0,0)); + - text: function keyword should not be used. + testString: getUserInput => assert(!getUserInput('index').match(/function/g)); ```