Skip to content
This repository was archived by the owner on Sep 25, 2019. It is now read-only.

Commit 2adc516

Browse files
nathanhannigscissorsneedfoodtoo
authored andcommitted
fix(challenges): adding negative integer to challenge to improve tests (#211)
1 parent 1a4f6a8 commit 2adc516

File tree

1 file changed

+10
-10
lines changed
  • challenges/02-javascript-algorithms-and-data-structures

1 file changed

+10
-10
lines changed

challenges/02-javascript-algorithms-and-data-structures/es6.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -414,24 +414,24 @@
414414
"<blockquote>FBPosts.filter((post) => post.thumbnail !== null && post.shares > 100 && post.likes > 500)</blockquote>",
415415
"This code is more succinct and accomplishes the same task with fewer lines of code.",
416416
"<hr>",
417-
"Use arrow function syntax to compute the square of only the positive integers (fractions are not integers) in the array <code>realNumberArray</code> and store the new array in the variable <code>squaredIntegers</code>."
417+
"Use arrow function syntax to compute the square of only the positive integers (decimal numbers are not integers) in the array <code>realNumberArray</code> and store the new array in the variable <code>squaredIntegers</code>."
418418
],
419419
"tests": [
420420
{
421-
"text": "User did replace <code>var</code> keyword.",
422-
"testString": "getUserInput => assert(!getUserInput('index').match(/var/g), 'User did replace <code>var</code> keyword.');"
423-
},
424-
{
425-
"text": "<code>squaredIntegers</code> should be a constant variable (by using <code>const</code>).",
426-
"testString": "getUserInput => assert(getUserInput('index').match(/const\\s+squaredIntegers/g), '<code>squaredIntegers</code> should be a constant variable (by using <code>const</code>).');"
421+
"text":
422+
"<code>squaredIntegers</code> should be a constant variable (by using <code>const</code>).",
423+
"testString":
424+
"getUserInput => assert(getUserInput('index').match(/const\\s+squaredIntegers/g), '<code>squaredIntegers</code> should be a constant variable (by using <code>const</code>).');"
427425
},
428426
{
429427
"text": "<code>squaredIntegers</code> should be an <code>array</code>",
430428
"testString": "assert(Array.isArray(squaredIntegers), '<code>squaredIntegers</code> should be an <code>array</code>');"
431429
},
432430
{
433-
"text": "<code>squaredIntegers</code> should be <code>[16, 1764, 36]</code>",
434-
"testString": "assert(squaredIntegers[0] === 16 && squaredIntegers[1] === 1764 && squaredIntegers[2] === 36, '<code>squaredIntegers</code> should be <code>[16, 1764, 36]</code>');"
431+
"text":
432+
"<code>squaredIntegers</code> should be <code>[16, 1764, 36]</code>",
433+
"testString":
434+
"assert.deepStrictEqual(squaredIntegers, [16, 1764, 36], '<code>squaredIntegers</code> should be <code>[16, 1764, 36]</code>');"
435435
},
436436
{
437437
"text": "<code>function</code> keyword was not used.",
@@ -455,7 +455,7 @@
455455
"ext": "js",
456456
"name": "index",
457457
"contents": [
458-
"const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34];",
458+
"const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2];",
459459
"const squareList = (arr) => {",
460460
" \"use strict\";",
461461
" // change code below this line",

0 commit comments

Comments
 (0)