Skip to content

Commit

Permalink
fix(challenges): adding negative integer to challenge to improve tests (
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhannig authored and scissorsneedfoodtoo committed Aug 22, 2018
1 parent 1a4f6a8 commit 2adc516
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions challenges/02-javascript-algorithms-and-data-structures/es6.json
Original file line number Diff line number Diff line change
Expand Up @@ -414,24 +414,24 @@
"<blockquote>FBPosts.filter((post) => post.thumbnail !== null && post.shares > 100 && post.likes > 500)</blockquote>",
"This code is more succinct and accomplishes the same task with fewer lines of code.",
"<hr>",
"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>."
"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>."
],
"tests": [
{
"text": "User did replace <code>var</code> keyword.",
"testString": "getUserInput => assert(!getUserInput('index').match(/var/g), 'User did replace <code>var</code> keyword.');"
},
{
"text": "<code>squaredIntegers</code> should be a constant variable (by using <code>const</code>).",
"testString": "getUserInput => assert(getUserInput('index').match(/const\\s+squaredIntegers/g), '<code>squaredIntegers</code> should be a constant variable (by using <code>const</code>).');"
"text":
"<code>squaredIntegers</code> should be a constant variable (by using <code>const</code>).",
"testString":
"getUserInput => assert(getUserInput('index').match(/const\\s+squaredIntegers/g), '<code>squaredIntegers</code> should be a constant variable (by using <code>const</code>).');"
},
{
"text": "<code>squaredIntegers</code> should be an <code>array</code>",
"testString": "assert(Array.isArray(squaredIntegers), '<code>squaredIntegers</code> should be an <code>array</code>');"
},
{
"text": "<code>squaredIntegers</code> should be <code>[16, 1764, 36]</code>",
"testString": "assert(squaredIntegers[0] === 16 && squaredIntegers[1] === 1764 && squaredIntegers[2] === 36, '<code>squaredIntegers</code> should be <code>[16, 1764, 36]</code>');"
"text":
"<code>squaredIntegers</code> should be <code>[16, 1764, 36]</code>",
"testString":
"assert.deepStrictEqual(squaredIntegers, [16, 1764, 36], '<code>squaredIntegers</code> should be <code>[16, 1764, 36]</code>');"
},
{
"text": "<code>function</code> keyword was not used.",
Expand All @@ -455,7 +455,7 @@
"ext": "js",
"name": "index",
"contents": [
"const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34];",
"const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2];",
"const squareList = (arr) => {",
" \"use strict\";",
" // change code below this line",
Expand Down

0 comments on commit 2adc516

Please sign in to comment.