fix(curriculum): Remove unnecessary assert message argument from English challenges JavaScript Algorithms and Data Structures - 03 (#36403)
* fix: rm assert msg basic-data-structures * fix: rm assert msg intermed-algo-scripting * fix: rm assert msg data-structures projects
This commit is contained in:
committed by
Oliver Eyton-Williams
parent
5bf8527523
commit
d78168f7db
@ -43,13 +43,13 @@ In order to complete this challenge, set the 2nd position (index <code>1</code>)
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>myArray[0]</code> is equal to <code>"a"</code>
|
||||
testString: assert.strictEqual(myArray[0], "a", '<code>myArray[0]</code> is equal to <code>"a"</code>');
|
||||
testString: assert.strictEqual(myArray[0], "a");
|
||||
- text: <code>myArray[1]</code> is no longer set to <code>"b"</code>
|
||||
testString: assert.notStrictEqual(myArray[1], "b", '<code>myArray[1]</code> is no longer set to <code>"b"</code>');
|
||||
testString: assert.notStrictEqual(myArray[1], "b");
|
||||
- text: <code>myArray[2]</code> is equal to <code>"c"</code>
|
||||
testString: assert.strictEqual(myArray[2], "c", '<code>myArray[2]</code> is equal to <code>"c"</code>');
|
||||
testString: assert.strictEqual(myArray[2], "c");
|
||||
- text: <code>myArray[3]</code> is equal to <code>"d"</code>
|
||||
testString: assert.strictEqual(myArray[3], "d", '<code>myArray[3]</code> is equal to <code>"d"</code>');
|
||||
testString: assert.strictEqual(myArray[3], "d");
|
||||
|
||||
```
|
||||
|
||||
|
@ -31,11 +31,11 @@ tests:
|
||||
- text: 'The <code>foods</code> object should have only the following key-value pairs: <code>apples: 25</code>, <code>oranges: 32</code>, <code>plums: 28</code>, <code>bananas: 13</code>, <code>grapes: 35</code>, <code>strawberries: 27</code>'
|
||||
testString: 'assert.deepEqual(foods, {apples: 25, oranges: 32, plums: 28, bananas: 13, grapes: 35, strawberries: 27}, ''The <code>foods</code> object should have only the following key-value pairs: <code>apples: 25</code>, <code>oranges: 32</code>, <code>plums: 28</code>, <code>bananas: 13</code>, <code>grapes: 35</code>, <code>strawberries: 27</code>'');'
|
||||
- text: <code>checkInventory("apples")</code> should return <code>25</code>
|
||||
testString: assert.strictEqual(checkInventory('apples'), 25, '<code>checkInventory("apples")</code> should return <code>25</code>');
|
||||
testString: assert.strictEqual(checkInventory('apples'), 25);
|
||||
- text: <code>checkInventory("bananas")</code> should return <code>13</code>
|
||||
testString: assert.strictEqual(checkInventory('bananas'), 13, '<code>checkInventory("bananas")</code> should return <code>13</code>');
|
||||
testString: assert.strictEqual(checkInventory('bananas'), 13);
|
||||
- text: <code>checkInventory("strawberries")</code> should return <code>27</code>
|
||||
testString: assert.strictEqual(checkInventory('strawberries'), 27, '<code>checkInventory("strawberries")</code> should return <code>27</code>');
|
||||
testString: assert.strictEqual(checkInventory('strawberries'), 27);
|
||||
|
||||
```
|
||||
|
||||
|
@ -37,11 +37,11 @@ tests:
|
||||
- text: <code>htmlColorNames</code> should return <code>["DarkSalmon", "BlanchedAlmond", "LavenderBlush", "PaleTurqoise", "FireBrick"]</code>
|
||||
testString: assert.deepEqual(htmlColorNames(['DarkGoldenRod', 'WhiteSmoke', 'LavenderBlush', 'PaleTurqoise', 'FireBrick']), ['DarkSalmon', 'BlanchedAlmond', 'LavenderBlush', 'PaleTurqoise', 'FireBrick'], '<code>htmlColorNames</code> should return <code>["DarkSalmon", "BlanchedAlmond", "LavenderBlush", "PaleTurqoise", "FireBrick"]</code>');
|
||||
- text: The <code>htmlColorNames</code> function should utilize the <code>splice()</code> method
|
||||
testString: assert(/.splice/.test(code), 'The <code>htmlColorNames</code> function should utilize the <code>splice()</code> method');
|
||||
testString: assert(/.splice/.test(code));
|
||||
- text: You should not use <code>shift()</code> or <code>unshift()</code>.
|
||||
testString: assert(!/shift|unshift/.test(code), 'You should not use <code>shift()</code> or <code>unshift()</code>.');
|
||||
testString: assert(!/shift|unshift/.test(code));
|
||||
- text: You should not use array bracket notation.
|
||||
testString: assert(!/\[\d\]\s*=/.test(code), 'You should not use array bracket notation.');
|
||||
testString: assert(!/\[\d\]\s*=/.test(code));
|
||||
|
||||
```
|
||||
|
||||
|
@ -45,15 +45,15 @@ Using the same syntax, we can also <em><strong>add new</strong></em> key-value p
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>foods</code> is an object
|
||||
testString: assert(typeof foods === 'object', '<code>foods</code> is an object');
|
||||
testString: assert(typeof foods === 'object');
|
||||
- text: The <code>foods</code> object has a key <code>"bananas"</code> with a value of <code>13</code>
|
||||
testString: assert(foods.bananas === 13, 'The <code>foods</code> object has a key <code>"bananas"</code> with a value of <code>13</code>');
|
||||
testString: assert(foods.bananas === 13);
|
||||
- text: The <code>foods</code> object has a key <code>"grapes"</code> with a value of <code>35</code>
|
||||
testString: assert(foods.grapes === 35, 'The <code>foods</code> object has a key <code>"grapes"</code> with a value of <code>35</code>');
|
||||
testString: assert(foods.grapes === 35);
|
||||
- text: The <code>foods</code> object has a key <code>"strawberries"</code> with a value of <code>27</code>
|
||||
testString: assert(foods.strawberries === 27, 'The <code>foods</code> object has a key <code>"strawberries"</code> with a value of <code>27</code>');
|
||||
testString: assert(foods.strawberries === 27);
|
||||
- text: The key-value pairs should be set using dot or bracket notation
|
||||
testString: assert(code.search(/bananas:/) === -1 && code.search(/grapes:/) === -1 && code.search(/strawberries:/) === -1, 'The key-value pairs should be set using dot or bracket notation');
|
||||
testString: assert(code.search(/bananas:/) === -1 && code.search(/grapes:/) === -1 && code.search(/strawberries:/) === -1);
|
||||
|
||||
```
|
||||
|
||||
|
@ -34,11 +34,11 @@ tests:
|
||||
- text: <code>quickCheck(["onions", "squash", "shallots"], "onions")</code> should return <code>true</code>
|
||||
testString: assert.strictEqual(quickCheck(['onions', 'squash', 'shallots'], 'onions'), true, '<code>quickCheck(["onions", "squash", "shallots"], "onions")</code> should return <code>true</code>');
|
||||
- text: <code>quickCheck([3, 5, 9, 125, 45, 2], 125)</code> should return <code>true</code>
|
||||
testString: assert.strictEqual(quickCheck([3, 5, 9, 125, 45, 2], 125), true, '<code>quickCheck([3, 5, 9, 125, 45, 2], 125)</code> should return <code>true</code>');
|
||||
testString: assert.strictEqual(quickCheck([3, 5, 9, 125, 45, 2], 125), true);
|
||||
- text: <code>quickCheck([true, false, false], undefined)</code> should return <code>false</code>
|
||||
testString: assert.strictEqual(quickCheck([true, false, false], undefined), false, '<code>quickCheck([true, false, false], undefined)</code> should return <code>false</code>');
|
||||
testString: assert.strictEqual(quickCheck([true, false, false], undefined), false);
|
||||
- text: The <code>quickCheck</code> function should utilize the <code>indexOf()</code> method
|
||||
testString: assert.notStrictEqual(quickCheck.toString().search(/\.indexOf\(/), -1, 'The <code>quickCheck</code> function should utilize the <code>indexOf()</code> method');
|
||||
testString: assert.notStrictEqual(quickCheck.toString().search(/\.indexOf\(/), -1);
|
||||
|
||||
```
|
||||
|
||||
|
@ -31,7 +31,7 @@ tests:
|
||||
- text: <code>spreadOut</code> should return <code>["learning", "to", "code", "is", "fun"]</code>
|
||||
testString: assert.deepEqual(spreadOut(), ['learning', 'to', 'code', 'is', 'fun'], '<code>spreadOut</code> should return <code>["learning", "to", "code", "is", "fun"]</code>');
|
||||
- text: The <code>spreadOut</code> function should utilize spread syntax
|
||||
testString: assert.notStrictEqual(spreadOut.toString().search(/[...]/), -1, 'The <code>spreadOut</code> function should utilize spread syntax');
|
||||
testString: assert.notStrictEqual(spreadOut.toString().search(/[...]/), -1);
|
||||
|
||||
```
|
||||
|
||||
|
@ -32,7 +32,7 @@ tests:
|
||||
- text: <code>forecast</code> should return <code>["warm", "sunny"]</code>
|
||||
testString: assert.deepEqual(forecast(['cold', 'rainy', 'warm', 'sunny', 'cool', 'thunderstorms']), ['warm', 'sunny'], '<code>forecast</code> should return <code>["warm", "sunny"]</code>');
|
||||
- text: The <code>forecast</code> function should utilize the <code>slice()</code> method
|
||||
testString: assert(/\.slice\(/.test(code), 'The <code>forecast</code> function should utilize the <code>slice()</code> method');
|
||||
testString: assert(/\.slice\(/.test(code));
|
||||
|
||||
```
|
||||
|
||||
|
@ -20,9 +20,9 @@ Finish writing the <code>getArrayOfUsers</code> function so that it returns an a
|
||||
```yml
|
||||
tests:
|
||||
- text: The <code>users</code> object only contains the keys <code>Alan</code>, <code>Jeff</code>, <code>Sarah</code>, and <code>Ryan</code>
|
||||
testString: assert('Alan' in users && 'Jeff' in users && 'Sarah' in users && 'Ryan' in users && Object.keys(users).length === 4, 'The <code>users</code> object only contains the keys <code>Alan</code>, <code>Jeff</code>, <code>Sarah</code>, and <code>Ryan</code>');
|
||||
testString: assert('Alan' in users && 'Jeff' in users && 'Sarah' in users && 'Ryan' in users && Object.keys(users).length === 4);
|
||||
- text: The <code>getArrayOfUsers</code> function returns an array which contains all the keys in the <code>users</code> object
|
||||
testString: assert((function() { users.Sam = {}; users.Lewis = {}; let R = getArrayOfUsers(users); return (R.indexOf('Alan') !== -1 && R.indexOf('Jeff') !== -1 && R.indexOf('Sarah') !== -1 && R.indexOf('Ryan') !== -1 && R.indexOf('Sam') !== -1 && R.indexOf('Lewis') !== -1); })() === true, 'The <code>getArrayOfUsers</code> function returns an array which contains all the keys in the <code>users</code> object');
|
||||
testString: assert((function() { users.Sam = {}; users.Lewis = {}; let R = getArrayOfUsers(users); return (R.indexOf('Alan') !== -1 && R.indexOf('Jeff') !== -1 && R.indexOf('Sarah') !== -1 && R.indexOf('Ryan') !== -1 && R.indexOf('Sam') !== -1 && R.indexOf('Lewis') !== -1); })() === true);
|
||||
|
||||
```
|
||||
|
||||
|
@ -38,15 +38,15 @@ We have defined a function, <code>filteredArray</code>, which takes <code>arr</c
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>filteredArray([[10, 8, 3], [14, 6, 23], [3, 18, 6]], 18)</code> should return <code>[ [10, 8, 3], [14, 6, 23] ]</code>
|
||||
testString: assert.deepEqual(filteredArray([ [10, 8, 3], [14, 6, 23], [3, 18, 6] ], 18), [[10, 8, 3], [14, 6, 23]], '<code>filteredArray([[10, 8, 3], [14, 6, 23], [3, 18, 6]], 18)</code> should return <code>[ [10, 8, 3], [14, 6, 23] ]</code>');
|
||||
testString: assert.deepEqual(filteredArray([ [10, 8, 3], [14, 6, 23], [3, 18, 6] ], 18), [[10, 8, 3], [14, 6, 23]]);
|
||||
- text: <code>filteredArray([ ["trumpets", 2], ["flutes", 4], ["saxophones", 2] ], 2)</code> should return <code>[ ["flutes", 4] ]</code>
|
||||
testString: assert.deepEqual(filteredArray([ ['trumpets', 2], ['flutes', 4], ['saxophones', 2] ], 2), [['flutes', 4]], '<code>filteredArray([ ["trumpets", 2], ["flutes", 4], ["saxophones", 2] ], 2)</code> should return <code>[ ["flutes", 4] ]</code>');
|
||||
testString: assert.deepEqual(filteredArray([ ['trumpets', 2], ['flutes', 4], ['saxophones', 2] ], 2), [['flutes', 4]]);
|
||||
- text: <code>filteredArray([ ["amy", "beth", "sam"], ["dave", "sean", "peter"] ], "peter")</code> should return <code>[ ["amy", "beth", "sam"] ]</code>
|
||||
testString: assert.deepEqual(filteredArray([['amy', 'beth', 'sam'], ['dave', 'sean', 'peter']], 'peter'), [['amy', 'beth', 'sam']], '<code>filteredArray([ ["amy", "beth", "sam"], ["dave", "sean", "peter"] ], "peter")</code> should return <code>[ ["amy", "beth", "sam"] ]</code>');
|
||||
- text: <code>filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3)</code> should return <code>[ ]</code>
|
||||
testString: assert.deepEqual(filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3), [], '<code>filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3)</code> should return <code>[ ]</code>');
|
||||
testString: assert.deepEqual(filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3), []);
|
||||
- text: The <code>filteredArray</code> function should utilize a <code>for</code> loop
|
||||
testString: assert.notStrictEqual(filteredArray.toString().search(/for/), -1, 'The <code>filteredArray</code> function should utilize a <code>for</code> loop');
|
||||
testString: assert.notStrictEqual(filteredArray.toString().search(/for/), -1);
|
||||
|
||||
```
|
||||
|
||||
|
@ -20,7 +20,7 @@ Take a look at the object we've provided in the code editor. The <code>user</cod
|
||||
```yml
|
||||
tests:
|
||||
- text: The <code>user</code> object has <code>name</code>, <code>age</code>, and <code>data</code> keys
|
||||
testString: assert('name' in user && 'age' in user && 'data' in user, 'The <code>user</code> object has <code>name</code>, <code>age</code>, and <code>data</code> keys');
|
||||
testString: assert('name' in user && 'age' in user && 'data' in user);
|
||||
- text: The <code>addFriend</code> function accepts a <code>user</code> object and a <code>friend</code> string as arguments and adds the friend to the array of <code>friends</code> in the <code>user</code> object
|
||||
testString: assert((function() { let L1 = user.data.friends.length; addFriend(user, 'Sean'); let L2 = user.data.friends.length; return (L2 === L1 + 1); })(), 'The <code>addFriend</code> function accepts a <code>user</code> object and a <code>friend</code> string as arguments and adds the friend to the array of <code>friends</code> in the <code>user</code> object');
|
||||
- text: <code>addFriend(user, "Pete")</code> should return <code>["Sam", "Kira", "Tomo", "Pete"]</code>
|
||||
|
@ -37,11 +37,11 @@ Here we've defined an object, <code>userActivity</code>, which includes another
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>userActivity</code> has <code>id</code>, <code>date</code> and <code>data</code> properties
|
||||
testString: assert('id' in userActivity && 'date' in userActivity && 'data' in userActivity, '<code>userActivity</code> has <code>id</code>, <code>date</code> and <code>data</code> properties');
|
||||
testString: assert('id' in userActivity && 'date' in userActivity && 'data' in userActivity);
|
||||
- text: <code>userActivity</code> has a <code>data</code> key set to an object with keys <code>totalUsers</code> and <code>online</code>
|
||||
testString: assert('totalUsers' in userActivity.data && 'online' in userActivity.data, '<code>userActivity</code> has a <code>data</code> key set to an object with keys <code>totalUsers</code> and <code>online</code>');
|
||||
testString: assert('totalUsers' in userActivity.data && 'online' in userActivity.data);
|
||||
- text: The <code>online</code> property nested in the <code>data</code> key of <code>userActivity</code> should be set to <code>45</code>
|
||||
testString: assert(userActivity.data.online === 45, 'The <code>online</code> property nested in the <code>data</code> key of <code>userActivity</code> should be set to <code>45</code>');
|
||||
testString: assert(userActivity.data.online === 45);
|
||||
- text: The <code>online</code> property is set using dot or bracket notation
|
||||
testString: 'assert.strictEqual(code.search(/online: 45/), -1, ''The <code>online</code> property is set using dot or bracket notation'');'
|
||||
|
||||
|
@ -42,9 +42,9 @@ tests:
|
||||
- text: <code>popShift(["challenge", "is", "not", "complete"])</code> should return <code>["challenge", "complete"]</code>
|
||||
testString: assert.deepEqual(popShift(['challenge', 'is', 'not', 'complete']), ["challenge", "complete"], '<code>popShift(["challenge", "is", "not", "complete"])</code> should return <code>["challenge", "complete"]</code>');
|
||||
- text: The <code>popShift</code> function should utilize the <code>pop()</code> method
|
||||
testString: assert.notStrictEqual(popShift.toString().search(/\.pop\(/), -1, 'The <code>popShift</code> function should utilize the <code>pop()</code> method');
|
||||
testString: assert.notStrictEqual(popShift.toString().search(/\.pop\(/), -1);
|
||||
- text: The <code>popShift</code> function should utilize the <code>shift()</code> method
|
||||
testString: assert.notStrictEqual(popShift.toString().search(/\.shift\(/), -1, 'The <code>popShift</code> function should utilize the <code>shift()</code> method');
|
||||
testString: assert.notStrictEqual(popShift.toString().search(/\.shift\(/), -1);
|
||||
|
||||
```
|
||||
|
||||
|
@ -39,9 +39,9 @@ We've defined a function, <code>sumOfTen</code>, which takes an array as an argu
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>sumOfTen</code> should return 10
|
||||
testString: assert.strictEqual(sumOfTen([2, 5, 1, 5, 2, 1]), 10, '<code>sumOfTen</code> should return 10');
|
||||
testString: assert.strictEqual(sumOfTen([2, 5, 1, 5, 2, 1]), 10);
|
||||
- text: The <code>sumOfTen</code> function should utilize the <code>splice()</code> method
|
||||
testString: assert.notStrictEqual(sumOfTen.toString().search(/\.splice\(/), -1, 'The <code>sumOfTen</code> function should utilize the <code>splice()</code> method');
|
||||
testString: assert.notStrictEqual(sumOfTen.toString().search(/\.splice\(/), -1);
|
||||
|
||||
```
|
||||
|
||||
|
@ -55,15 +55,15 @@ We have defined a variable called <code>yourArray</code>. Complete the statement
|
||||
```yml
|
||||
tests:
|
||||
- text: yourArray is an array
|
||||
testString: assert.strictEqual(Array.isArray(yourArray), true, 'yourArray is an array');
|
||||
testString: assert.strictEqual(Array.isArray(yourArray), true);
|
||||
- text: <code>yourArray</code> is at least 5 elements long
|
||||
testString: assert.isAtLeast(yourArray.length, 5, '<code>yourArray</code> is at least 5 elements long');
|
||||
testString: assert.isAtLeast(yourArray.length, 5);
|
||||
- text: <code>yourArray</code> contains at least one <code>boolean</code>
|
||||
testString: assert(yourArray.filter( el => typeof el === 'boolean').length >= 1, '<code>yourArray</code> contains at least one <code>boolean</code>');
|
||||
testString: assert(yourArray.filter( el => typeof el === 'boolean').length >= 1);
|
||||
- text: <code>yourArray</code> contains at least one <code>number</code>
|
||||
testString: assert(yourArray.filter( el => typeof el === 'number').length >= 1, '<code>yourArray</code> contains at least one <code>number</code>');
|
||||
testString: assert(yourArray.filter( el => typeof el === 'number').length >= 1);
|
||||
- text: <code>yourArray</code> contains at least one <code>string</code>
|
||||
testString: assert(yourArray.filter( el => typeof el === 'string').length >= 1, '<code>yourArray</code> contains at least one <code>string</code>');
|
||||
testString: assert(yourArray.filter( el => typeof el === 'string').length >= 1);
|
||||
|
||||
```
|
||||
|
||||
|
@ -29,7 +29,7 @@ tests:
|
||||
- text: 'The <code>foods</code> object only has three keys: <code>apples</code>, <code>grapes</code>, and <code>bananas</code>'
|
||||
testString: 'assert(!foods.hasOwnProperty(''oranges'') && !foods.hasOwnProperty(''plums'') && !foods.hasOwnProperty(''strawberries'') && Object.keys(foods).length === 3, ''The <code>foods</code> object only has three keys: <code>apples</code>, <code>grapes</code>, and <code>bananas</code>'');'
|
||||
- text: The <code>oranges</code>, <code>plums</code>, and <code>strawberries</code> keys are removed using <code>delete</code>
|
||||
testString: assert(code.search(/oranges:/) !== -1 && code.search(/plums:/) !== -1 && code.search(/strawberries:/) !== -1, 'The <code>oranges</code>, <code>plums</code>, and <code>strawberries</code> keys are removed using <code>delete</code>');
|
||||
testString: assert(code.search(/oranges:/) !== -1 && code.search(/plums:/) !== -1 && code.search(/strawberries:/) !== -1);
|
||||
|
||||
```
|
||||
|
||||
|
@ -27,15 +27,15 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>addTogether(2, 3)</code> should return 5.
|
||||
testString: assert.deepEqual(addTogether(2, 3), 5, '<code>addTogether(2, 3)</code> should return 5.');
|
||||
testString: assert.deepEqual(addTogether(2, 3), 5);
|
||||
- text: <code>addTogether(2)(3)</code> should return 5.
|
||||
testString: assert.deepEqual(addTogether(2)(3), 5, '<code>addTogether(2)(3)</code> should return 5.');
|
||||
testString: assert.deepEqual(addTogether(2)(3), 5);
|
||||
- text: <code>addTogether("http://bit.ly/IqT6zt")</code> should return undefined.
|
||||
testString: assert.isUndefined(addTogether("http://bit.ly/IqT6zt"), '<code>addTogether("http://bit.ly/IqT6zt")</code> should return undefined.');
|
||||
testString: assert.isUndefined(addTogether("http://bit.ly/IqT6zt"));
|
||||
- text: <code>addTogether(2, "3")</code> should return undefined.
|
||||
testString: assert.isUndefined(addTogether(2, "3"), '<code>addTogether(2, "3")</code> should return undefined.');
|
||||
testString: assert.isUndefined(addTogether(2, "3"));
|
||||
- text: <code>addTogether(2)([3])</code> should return undefined.
|
||||
testString: assert.isUndefined(addTogether(2)([3]), '<code>addTogether(2)([3])</code> should return undefined.');
|
||||
testString: assert.isUndefined(addTogether(2)([3]));
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,9 +23,9 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>binaryAgent("01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111")</code> should return "Aren't bonfires fun!?"
|
||||
testString: assert.deepEqual(binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111'), "Aren't bonfires fun!?", '<code>binaryAgent("01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111")</code> should return "Aren't bonfires fun!?"');
|
||||
testString: assert.deepEqual(binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111'), "Aren't bonfires fun!?");
|
||||
- text: <code>binaryAgent("01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001")</code> should return "I love FreeCodeCamp!"
|
||||
testString: assert.deepEqual(binaryAgent('01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001'), "I love FreeCodeCamp!", '<code>binaryAgent("01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001")</code> should return "I love FreeCodeCamp!"');
|
||||
testString: assert.deepEqual(binaryAgent('01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001'), "I love FreeCodeCamp!");
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,35 +23,35 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5])</code> should return an array.
|
||||
testString: assert(typeof diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]) === "object", '<code>diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5])</code> should return an array.');
|
||||
testString: assert(typeof diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]) === "object");
|
||||
- text: <code>["diorite", "andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]</code> should return <code>["pink wool"]</code>.
|
||||
testString: assert.sameMembers(diffArray(["diorite", "andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]), ["pink wool"], '<code>["diorite", "andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]</code> should return <code>["pink wool"]</code>.');
|
||||
testString: assert.sameMembers(diffArray(["diorite", "andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]), ["pink wool"]);
|
||||
- text: <code>["diorite", "andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]</code> should return an array with one item.
|
||||
testString: assert(diffArray(["diorite", "andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]).length === 1, '<code>["diorite", "andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]</code> should return an array with one item.');
|
||||
testString: assert(diffArray(["diorite", "andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]).length === 1);
|
||||
- text: <code>["andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]</code> should return <code>["diorite", "pink wool"]</code>.
|
||||
testString: assert.sameMembers(diffArray(["andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]), ["diorite", "pink wool"], '<code>["andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]</code> should return <code>["diorite", "pink wool"]</code>.');
|
||||
testString: assert.sameMembers(diffArray(["andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]), ["diorite", "pink wool"]);
|
||||
- text: <code>["andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]</code> should return an array with two items.
|
||||
testString: assert(diffArray(["andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]).length === 2, '<code>["andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]</code> should return an array with two items.');
|
||||
testString: assert(diffArray(["andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]).length === 2);
|
||||
- text: <code>["andesite", "grass", "dirt", "dead shrub"], ["andesite", "grass", "dirt", "dead shrub"]</code> should return <code>[]</code>.
|
||||
testString: assert.sameMembers(diffArray(["andesite", "grass", "dirt", "dead shrub"], ["andesite", "grass", "dirt", "dead shrub"]), [], '<code>["andesite", "grass", "dirt", "dead shrub"], ["andesite", "grass", "dirt", "dead shrub"]</code> should return <code>[]</code>.');
|
||||
testString: assert.sameMembers(diffArray(["andesite", "grass", "dirt", "dead shrub"], ["andesite", "grass", "dirt", "dead shrub"]), []);
|
||||
- text: <code>["andesite", "grass", "dirt", "dead shrub"], ["andesite", "grass", "dirt", "dead shrub"]</code> should return an empty array.
|
||||
testString: assert(diffArray(["andesite", "grass", "dirt", "dead shrub"], ["andesite", "grass", "dirt", "dead shrub"]).length === 0, '<code>["andesite", "grass", "dirt", "dead shrub"], ["andesite", "grass", "dirt", "dead shrub"]</code> should return an empty array.');
|
||||
testString: assert(diffArray(["andesite", "grass", "dirt", "dead shrub"], ["andesite", "grass", "dirt", "dead shrub"]).length === 0);
|
||||
- text: <code>[1, 2, 3, 5], [1, 2, 3, 4, 5]</code> should return <code>[4]</code>.
|
||||
testString: assert.sameMembers(diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]), [4], '<code>[1, 2, 3, 5], [1, 2, 3, 4, 5]</code> should return <code>[4]</code>.');
|
||||
testString: assert.sameMembers(diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]), [4]);
|
||||
- text: <code>[1, 2, 3, 5], [1, 2, 3, 4, 5]</code> should return an array with one item.
|
||||
testString: assert(diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]).length === 1, '<code>[1, 2, 3, 5], [1, 2, 3, 4, 5]</code> should return an array with one item.');
|
||||
testString: assert(diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]).length === 1);
|
||||
- text: <code>[1, "calf", 3, "piglet"], [1, "calf", 3, 4]</code> should return <code>["piglet", 4]</code>.
|
||||
testString: assert.sameMembers(diffArray([1, "calf", 3, "piglet"], [1, "calf", 3, 4]), ["piglet", 4], '<code>[1, "calf", 3, "piglet"], [1, "calf", 3, 4]</code> should return <code>["piglet", 4]</code>.');
|
||||
testString: assert.sameMembers(diffArray([1, "calf", 3, "piglet"], [1, "calf", 3, 4]), ["piglet", 4]);
|
||||
- text: <code>[1, "calf", 3, "piglet"], [1, "calf", 3, 4]</code> should return an array with two items.
|
||||
testString: assert(diffArray([1, "calf", 3, "piglet"], [1, "calf", 3, 4]).length === 2, '<code>[1, "calf", 3, "piglet"], [1, "calf", 3, 4]</code> should return an array with two items.');
|
||||
testString: assert(diffArray([1, "calf", 3, "piglet"], [1, "calf", 3, 4]).length === 2);
|
||||
- text: <code>[], ["snuffleupagus", "cookie monster", "elmo"]</code> should return <code>["snuffleupagus", "cookie monster", "elmo"]</code>.
|
||||
testString: assert.sameMembers(diffArray([], ["snuffleupagus", "cookie monster", "elmo"]), ["snuffleupagus", "cookie monster", "elmo"], '<code>[], ["snuffleupagus", "cookie monster", "elmo"]</code> should return <code>["snuffleupagus", "cookie monster", "elmo"]</code>.');
|
||||
testString: assert.sameMembers(diffArray([], ["snuffleupagus", "cookie monster", "elmo"]), ["snuffleupagus", "cookie monster", "elmo"]);
|
||||
- text: <code>[], ["snuffleupagus", "cookie monster", "elmo"]</code> should return an array with three items.
|
||||
testString: assert(diffArray([], ["snuffleupagus", "cookie monster", "elmo"]).length === 3, '<code>[], ["snuffleupagus", "cookie monster", "elmo"]</code> should return an array with three items.');
|
||||
testString: assert(diffArray([], ["snuffleupagus", "cookie monster", "elmo"]).length === 3);
|
||||
- text: <code>[1, "calf", 3, "piglet"], [7, "filly"]</code> should return <code>[1, "calf", 3, "piglet", 7, "filly"]</code>.
|
||||
testString: assert.sameMembers(diffArray([1, "calf", 3, "piglet"], [7, "filly"]), [1, "calf", 3, "piglet", 7, "filly"], '<code>[1, "calf", 3, "piglet"], [7, "filly"]</code> should return <code>[1, "calf", 3, "piglet", 7, "filly"]</code>.');
|
||||
testString: assert.sameMembers(diffArray([1, "calf", 3, "piglet"], [7, "filly"]), [1, "calf", 3, "piglet", 7, "filly"]);
|
||||
- text: <code>[1, "calf", 3, "piglet"], [7, "filly"]</code> should return an array with six items.
|
||||
testString: assert(diffArray([1, "calf", 3, "piglet"], [7, "filly"]).length === 6, '<code>[1, "calf", 3, "piglet"], [7, "filly"]</code> should return an array with six items.');
|
||||
testString: assert(diffArray([1, "calf", 3, "piglet"], [7, "filly"]).length === 6);
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,11 +26,11 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>pairElement("ATCGA")</code> should return <code>[["A","T"],["T","A"],["C","G"],["G","C"],["A","T"]]</code>.
|
||||
testString: assert.deepEqual(pairElement("ATCGA"),[["A","T"],["T","A"],["C","G"],["G","C"],["A","T"]], '<code>pairElement("ATCGA")</code> should return <code>[["A","T"],["T","A"],["C","G"],["G","C"],["A","T"]]</code>.');
|
||||
testString: assert.deepEqual(pairElement("ATCGA"),[["A","T"],["T","A"],["C","G"],["G","C"],["A","T"]]);
|
||||
- text: <code>pairElement("TTGAG")</code> should return <code>[["T","A"],["T","A"],["G","C"],["A","T"],["G","C"]]</code>.
|
||||
testString: assert.deepEqual(pairElement("TTGAG"),[["T","A"],["T","A"],["G","C"],["A","T"],["G","C"]], '<code>pairElement("TTGAG")</code> should return <code>[["T","A"],["T","A"],["G","C"],["A","T"],["G","C"]]</code>.');
|
||||
testString: assert.deepEqual(pairElement("TTGAG"),[["T","A"],["T","A"],["G","C"],["A","T"],["G","C"]]);
|
||||
- text: <code>pairElement("CTCTA")</code> should return <code>[["C","G"],["T","A"],["C","G"],["T","A"],["A","T"]]</code>.
|
||||
testString: assert.deepEqual(pairElement("CTCTA"),[["C","G"],["T","A"],["C","G"],["T","A"],["A","T"]], '<code>pairElement("CTCTA")</code> should return <code>[["C","G"],["T","A"],["C","G"],["T","A"],["A","T"]]</code>.');
|
||||
testString: assert.deepEqual(pairElement("CTCTA"),[["C","G"],["T","A"],["C","G"],["T","A"],["A","T"]]);
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,17 +23,17 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>dropElements([1, 2, 3, 4], function(n) {return n >= 3;})</code> should return <code>[3, 4]</code>.
|
||||
testString: assert.deepEqual(dropElements([1, 2, 3, 4], function(n) {return n >= 3;}), [3, 4], '<code>dropElements([1, 2, 3, 4], function(n) {return n >= 3;})</code> should return <code>[3, 4]</code>.');
|
||||
testString: assert.deepEqual(dropElements([1, 2, 3, 4], function(n) {return n >= 3;}), [3, 4]);
|
||||
- text: <code>dropElements([0, 1, 0, 1], function(n) {return n === 1;})</code> should return <code>[1, 0, 1]</code>.
|
||||
testString: assert.deepEqual(dropElements([0, 1, 0, 1], function(n) {return n === 1;}), [1, 0, 1], '<code>dropElements([0, 1, 0, 1], function(n) {return n === 1;})</code> should return <code>[1, 0, 1]</code>.');
|
||||
testString: assert.deepEqual(dropElements([0, 1, 0, 1], function(n) {return n === 1;}), [1, 0, 1]);
|
||||
- text: <code>dropElements([1, 2, 3], function(n) {return n > 0;})</code> should return <code>[1, 2, 3]</code>.
|
||||
testString: assert.deepEqual(dropElements([1, 2, 3], function(n) {return n > 0;}), [1, 2, 3], '<code>dropElements([1, 2, 3], function(n) {return n > 0;})</code> should return <code>[1, 2, 3]</code>.');
|
||||
testString: assert.deepEqual(dropElements([1, 2, 3], function(n) {return n > 0;}), [1, 2, 3]);
|
||||
- text: <code>dropElements([1, 2, 3, 4], function(n) {return n > 5;})</code> should return <code>[]</code>.
|
||||
testString: assert.deepEqual(dropElements([1, 2, 3, 4], function(n) {return n > 5;}), [], '<code>dropElements([1, 2, 3, 4], function(n) {return n > 5;})</code> should return <code>[]</code>.');
|
||||
testString: assert.deepEqual(dropElements([1, 2, 3, 4], function(n) {return n > 5;}), []);
|
||||
- text: <code>dropElements([1, 2, 3, 7, 4], function(n) {return n > 3;})</code> should return <code>[7, 4]</code>.
|
||||
testString: assert.deepEqual(dropElements([1, 2, 3, 7, 4], function(n) {return n > 3;}), [7, 4], '<code>dropElements([1, 2, 3, 7, 4], function(n) {return n > 3;})</code> should return <code>[7, 4]</code>.');
|
||||
testString: assert.deepEqual(dropElements([1, 2, 3, 7, 4], function(n) {return n > 3;}), [7, 4]);
|
||||
- text: <code>dropElements([1, 2, 3, 9, 2], function(n) {return n > 2;})</code> should return <code>[3, 9, 2]</code>.
|
||||
testString: assert.deepEqual(dropElements([1, 2, 3, 9, 2], function(n) {return n > 2;}), [3, 9, 2], '<code>dropElements([1, 2, 3, 9, 2], function(n) {return n > 2;})</code> should return <code>[3, 9, 2]</code>.');
|
||||
testString: assert.deepEqual(dropElements([1, 2, 3, 9, 2], function(n) {return n > 2;}), [3, 9, 2]);
|
||||
|
||||
```
|
||||
|
||||
|
@ -34,13 +34,13 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>Object.keys(bob).length</code> should return 6.
|
||||
testString: assert.deepEqual(Object.keys(bob).length, 6, '<code>Object.keys(bob).length</code> should return 6.');
|
||||
testString: assert.deepEqual(Object.keys(bob).length, 6);
|
||||
- text: <code>bob instanceof Person</code> should return true.
|
||||
testString: assert.deepEqual(bob instanceof Person, true, '<code>bob instanceof Person</code> should return true.');
|
||||
testString: assert.deepEqual(bob instanceof Person, true);
|
||||
- text: <code>bob.firstName</code> should return undefined.
|
||||
testString: assert.deepEqual(bob.firstName, undefined, '<code>bob.firstName</code> should return undefined.');
|
||||
testString: assert.deepEqual(bob.firstName, undefined);
|
||||
- text: <code>bob.lastName</code> should return undefined.
|
||||
testString: assert.deepEqual(bob.lastName, undefined, '<code>bob.lastName</code> should return undefined.');
|
||||
testString: assert.deepEqual(bob.lastName, undefined);
|
||||
- text: <code>bob.getFirstName()</code> should return "Bob".
|
||||
testString: assert.deepEqual(bob.getFirstName(), 'Bob', '<code>bob.getFirstName()</code> should return "Bob".');
|
||||
- text: <code>bob.getLastName()</code> should return "Ross".
|
||||
|
@ -31,7 +31,7 @@ tests:
|
||||
- text: <code>fearNotLetter("bcdf")</code> should return "e".
|
||||
testString: assert.deepEqual(fearNotLetter('bcdf'), 'e', '<code>fearNotLetter("bcdf")</code> should return "e".');
|
||||
- text: <code>fearNotLetter("abcdefghijklmnopqrstuvwxyz")</code> should return undefined.
|
||||
testString: assert.isUndefined(fearNotLetter('abcdefghijklmnopqrstuvwxyz'), '<code>fearNotLetter("abcdefghijklmnopqrstuvwxyz")</code> should return undefined.');
|
||||
testString: assert.isUndefined(fearNotLetter('abcdefghijklmnopqrstuvwxyz'));
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,17 +26,17 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>translatePigLatin("california")</code> should return "aliforniacay".
|
||||
testString: assert.deepEqual(translatePigLatin("california"), "aliforniacay", '<code>translatePigLatin("california")</code> should return "aliforniacay".');
|
||||
testString: assert.deepEqual(translatePigLatin("california"), "aliforniacay");
|
||||
- text: <code>translatePigLatin("paragraphs")</code> should return "aragraphspay".
|
||||
testString: assert.deepEqual(translatePigLatin("paragraphs"), "aragraphspay", '<code>translatePigLatin("paragraphs")</code> should return "aragraphspay".');
|
||||
testString: assert.deepEqual(translatePigLatin("paragraphs"), "aragraphspay");
|
||||
- text: <code>translatePigLatin("glove")</code> should return "oveglay".
|
||||
testString: assert.deepEqual(translatePigLatin("glove"), "oveglay", '<code>translatePigLatin("glove")</code> should return "oveglay".');
|
||||
testString: assert.deepEqual(translatePigLatin("glove"), "oveglay");
|
||||
- text: <code>translatePigLatin("algorithm")</code> should return "algorithmway".
|
||||
testString: assert.deepEqual(translatePigLatin("algorithm"), "algorithmway", '<code>translatePigLatin("algorithm")</code> should return "algorithmway".');
|
||||
testString: assert.deepEqual(translatePigLatin("algorithm"), "algorithmway");
|
||||
- text: <code>translatePigLatin("eight")</code> should return "eightway".
|
||||
testString: assert.deepEqual(translatePigLatin("eight"), "eightway", '<code>translatePigLatin("eight")</code> should return "eightway".');
|
||||
testString: assert.deepEqual(translatePigLatin("eight"), "eightway");
|
||||
- text: Should handle words where the first vowel comes in the middle of the word. <code>translatePigLatin("schwartz")</code> should return "artzschway".
|
||||
testString: assert.deepEqual(translatePigLatin("schwartz"), "artzschway", 'Should handle words where the first vowel comes in the end of the word.');
|
||||
testString: assert.deepEqual(translatePigLatin("schwartz"), "artzschway");
|
||||
- text: Should handle words without vowels. <code>translatePigLatin("rhythm")</code> should return "rhythmay".
|
||||
testString: assert.deepEqual(translatePigLatin("rhythm"), "rhythmay");
|
||||
|
||||
|
@ -26,15 +26,15 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>myReplace("Let us go to the store", "store", "mall")</code> should return "Let us go to the mall".
|
||||
testString: assert.deepEqual(myReplace("Let us go to the store", "store", "mall"), "Let us go to the mall", '<code>myReplace("Let us go to the store", "store", "mall")</code> should return "Let us go to the mall".');
|
||||
testString: assert.deepEqual(myReplace("Let us go to the store", "store", "mall"), "Let us go to the mall");
|
||||
- text: <code>myReplace("He is Sleeping on the couch", "Sleeping", "sitting")</code> should return "He is Sitting on the couch".
|
||||
testString: assert.deepEqual(myReplace("He is Sleeping on the couch", "Sleeping", "sitting"), "He is Sitting on the couch", '<code>myReplace("He is Sleeping on the couch", "Sleeping", "sitting")</code> should return "He is Sitting on the couch".');
|
||||
testString: assert.deepEqual(myReplace("He is Sleeping on the couch", "Sleeping", "sitting"), "He is Sitting on the couch");
|
||||
- text: <code>myReplace("This has a spellngi error", "spellngi", "spelling")</code> should return "This has a spelling error".
|
||||
testString: assert.deepEqual(myReplace("This has a spellngi error", "spellngi", "spelling"), "This has a spelling error", '<code>myReplace("This has a spellngi error", "spellngi", "spelling")</code> should return "This has a spelling error".');
|
||||
testString: assert.deepEqual(myReplace("This has a spellngi error", "spellngi", "spelling"), "This has a spelling error");
|
||||
- text: <code>myReplace("His name is Tom", "Tom", "john")</code> should return "His name is John".
|
||||
testString: assert.deepEqual(myReplace("His name is Tom", "Tom", "john"), "His name is John", '<code>myReplace("His name is Tom", "Tom", "john")</code> should return "His name is John".');
|
||||
testString: assert.deepEqual(myReplace("His name is Tom", "Tom", "john"), "His name is John");
|
||||
- text: <code>myReplace("Let us get back to more Coding", "Coding", "algorithms")</code> should return "Let us get back to more Algorithms".
|
||||
testString: assert.deepEqual(myReplace("Let us get back to more Coding", "Coding", "algorithms"), "Let us get back to more Algorithms", '<code>myReplace("Let us get back to more Coding", "Coding", "algorithms")</code> should return "Let us get back to more Algorithms".');
|
||||
testString: assert.deepEqual(myReplace("Let us get back to more Coding", "Coding", "algorithms"), "Let us get back to more Algorithms");
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,17 +23,17 @@ Remember to use <a href="http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>destroyer([1, 2, 3, 1, 2, 3], 2, 3)</code> should return <code>[1, 1]</code>.
|
||||
testString: assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1], '<code>destroyer([1, 2, 3, 1, 2, 3], 2, 3)</code> should return <code>[1, 1]</code>.');
|
||||
testString: assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1]);
|
||||
- text: <code>destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3)</code> should return <code>[1, 5, 1]</code>.
|
||||
testString: assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], '<code>destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3)</code> should return <code>[1, 5, 1]</code>.');
|
||||
testString: assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1]);
|
||||
- text: <code>destroyer([3, 5, 1, 2, 2], 2, 3, 5)</code> should return <code>[1]</code>.
|
||||
testString: assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1], '<code>destroyer([3, 5, 1, 2, 2], 2, 3, 5)</code> should return <code>[1]</code>.');
|
||||
testString: assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1]);
|
||||
- text: <code>destroyer([2, 3, 2, 3], 2, 3)</code> should return <code>[]</code>.
|
||||
testString: assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), [], '<code>destroyer([2, 3, 2, 3], 2, 3)</code> should return <code>[]</code>.');
|
||||
testString: assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), []);
|
||||
- text: <code>destroyer(["tree", "hamburger", 53], "tree", 53)</code> should return <code>["hamburger"]</code>.
|
||||
testString: assert.deepEqual(destroyer(["tree", "hamburger", 53], "tree", 53), ["hamburger"], '<code>destroyer(["tree", "hamburger", 53], "tree", 53)</code> should return <code>["hamburger"]</code>.');
|
||||
testString: assert.deepEqual(destroyer(["tree", "hamburger", 53], "tree", 53), ["hamburger"]);
|
||||
- text: <code>destroyer(["possum", "trollo", 12, "safari", "hotdog", 92, 65, "grandma", "bugati", "trojan", "yacht"], "yacht", "possum", "trollo", "safari", "hotdog", "grandma", "bugati", "trojan")</code> should return <code>[12,92,65]</code>.
|
||||
testString: assert.deepEqual(destroyer(["possum", "trollo", 12, "safari", "hotdog", 92, 65, "grandma", "bugati", "trojan", "yacht"], "yacht", "possum", "trollo", "safari", "hotdog", "grandma", "bugati", "trojan"), [12,92,65], '<code>destroyer(["possum", "trollo", 12, "safari", "hotdog", 92, 65, "grandma", "bugati", "trojan", "yacht"], "yacht", "possum", "trollo", "safari", "hotdog", "grandma", "bugati", "trojan")</code> should return <code>[12,92,65]</code>.');
|
||||
testString: assert.deepEqual(destroyer(["possum", "trollo", 12, "safari", "hotdog", 92, 65, "grandma", "bugati", "trojan", "yacht"], "yacht", "possum", "trollo", "safari", "hotdog", "grandma", "bugati", "trojan"), [12,92,65]);
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,15 +26,15 @@ tests:
|
||||
- text: <code>smallestCommons([1, 5])</code> should return a number.
|
||||
testString: assert.deepEqual(typeof smallestCommons([1, 5]), 'number', '<code>smallestCommons([1, 5])</code> should return a number.');
|
||||
- text: <code>smallestCommons([1, 5])</code> should return 60.
|
||||
testString: assert.deepEqual(smallestCommons([1, 5]), 60, '<code>smallestCommons([1, 5])</code> should return 60.');
|
||||
testString: assert.deepEqual(smallestCommons([1, 5]), 60);
|
||||
- text: <code>smallestCommons([5, 1])</code> should return 60.
|
||||
testString: assert.deepEqual(smallestCommons([5, 1]), 60, '<code>smallestCommons([5, 1])</code> should return 60.');
|
||||
testString: assert.deepEqual(smallestCommons([5, 1]), 60);
|
||||
- text: <code>smallestCommons([2, 10])</code> should return 2520.
|
||||
testString: assert.deepEqual(smallestCommons([2, 10]), 2520, '<code>smallestCommons([2, 10])</code> should return 2520.');
|
||||
testString: assert.deepEqual(smallestCommons([2, 10]), 2520);
|
||||
- text: <code>smallestCommons([1, 13])</code> should return 360360.
|
||||
testString: assert.deepEqual(smallestCommons([1, 13]), 360360, '<code>smallestCommons([1, 13])</code> should return 360360.');
|
||||
testString: assert.deepEqual(smallestCommons([1, 13]), 360360);
|
||||
- text: <code>smallestCommons([23, 18])</code> should return 6056820.
|
||||
testString: assert.deepEqual(smallestCommons([23, 18]), 6056820, '<code>smallestCommons([23, 18])</code> should return 6056820.');
|
||||
testString: assert.deepEqual(smallestCommons([23, 18]), 6056820);
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,11 +25,11 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1])</code> should return <code>[1, 3, 2, 5, 4]</code>.
|
||||
testString: assert.deepEqual(uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]), [1, 3, 2, 5, 4], '<code>uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1])</code> should return <code>[1, 3, 2, 5, 4]</code>.');
|
||||
testString: assert.deepEqual(uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]), [1, 3, 2, 5, 4]);
|
||||
- text: <code>uniteUnique([1, 2, 3], [5, 2, 1])</code> should return <code>[1, 2, 3, 5]</code>.
|
||||
testString: assert.deepEqual(uniteUnique([1, 2, 3], [5, 2, 1]), [1, 2, 3, 5], '<code>uniteUnique([1, 2, 3], [5, 2, 1])</code> should return <code>[1, 2, 3, 5]</code>.');
|
||||
testString: assert.deepEqual(uniteUnique([1, 2, 3], [5, 2, 1]), [1, 2, 3, 5]);
|
||||
- text: <code>uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8])</code> should return <code>[1, 2, 3, 5, 4, 6, 7, 8]</code>.
|
||||
testString: assert.deepEqual(uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]), [1, 2, 3, 5, 4, 6, 7, 8], '<code>uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8])</code> should return <code>[1, 2, 3, 5, 4, 6, 7, 8]</code>.');
|
||||
testString: assert.deepEqual(uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]), [1, 2, 3, 5, 4, 6, 7, 8]);
|
||||
|
||||
```
|
||||
|
||||
|
@ -22,15 +22,15 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>spinalCase("This Is Spinal Tap")</code> should return <code>"this-is-spinal-tap"</code>.
|
||||
testString: assert.deepEqual(spinalCase("This Is Spinal Tap"), "this-is-spinal-tap", '<code>spinalCase("This Is Spinal Tap")</code> should return <code>"this-is-spinal-tap"</code>.');
|
||||
testString: assert.deepEqual(spinalCase("This Is Spinal Tap"), "this-is-spinal-tap");
|
||||
- text: <code>spinalCase("thisIsSpinal<wbr>Tap")</code> should return <code>"this-is-spinal-tap"</code>.
|
||||
testString: assert.strictEqual(spinalCase('thisIsSpinalTap'), "this-is-spinal-tap", '<code>spinalCase("thisIsSpinal<wbr>Tap")</code> should return <code>"this-is-spinal-tap"</code>.');
|
||||
testString: assert.strictEqual(spinalCase('thisIsSpinalTap'), "this-is-spinal-tap");
|
||||
- text: <code>spinalCase("The_Andy_<wbr>Griffith_Show")</code> should return <code>"the-andy-griffith-show"</code>.
|
||||
testString: assert.strictEqual(spinalCase("The_Andy_Griffith_Show"), "the-andy-griffith-show", '<code>spinalCase("The_Andy_<wbr>Griffith_Show")</code> should return <code>"the-andy-griffith-show"</code>.');
|
||||
testString: assert.strictEqual(spinalCase("The_Andy_Griffith_Show"), "the-andy-griffith-show");
|
||||
- text: <code>spinalCase("Teletubbies say Eh-oh")</code> should return <code>"teletubbies-say-eh-oh"</code>.
|
||||
testString: assert.strictEqual(spinalCase("Teletubbies say Eh-oh"), "teletubbies-say-eh-oh", '<code>spinalCase("Teletubbies say Eh-oh")</code> should return <code>"teletubbies-say-eh-oh"</code>.');
|
||||
testString: assert.strictEqual(spinalCase("Teletubbies say Eh-oh"), "teletubbies-say-eh-oh");
|
||||
- text: <code>spinalCase("AllThe-small Things")</code> should return <code>"all-the-small-things"</code>.
|
||||
testString: assert.strictEqual(spinalCase("AllThe-small Things"), "all-the-small-things", '<code>spinalCase("AllThe-small Things")</code> should return <code>"all-the-small-things"</code>.');
|
||||
testString: assert.strictEqual(spinalCase("AllThe-small Things"), "all-the-small-things");
|
||||
|
||||
```
|
||||
|
||||
|
@ -22,13 +22,13 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>steamrollArray([[["a"]], [["b"]]])</code> should return <code>["a", "b"]</code>.
|
||||
testString: assert.deepEqual(steamrollArray([[["a"]], [["b"]]]), ["a", "b"], '<code>steamrollArray([[["a"]], [["b"]]])</code> should return <code>["a", "b"]</code>.');
|
||||
testString: assert.deepEqual(steamrollArray([[["a"]], [["b"]]]), ["a", "b"]);
|
||||
- text: <code>steamrollArray([1, [2], [3, [[4]]]])</code> should return <code>[1, 2, 3, 4]</code>.
|
||||
testString: assert.deepEqual(steamrollArray([1, [2], [3, [[4]]]]), [1, 2, 3, 4], '<code>steamrollArray([1, [2], [3, [[4]]]])</code> should return <code>[1, 2, 3, 4]</code>.');
|
||||
testString: assert.deepEqual(steamrollArray([1, [2], [3, [[4]]]]), [1, 2, 3, 4]);
|
||||
- text: <code>steamrollArray([1, [], [3, [[4]]]])</code> should return <code>[1, 3, 4]</code>.
|
||||
testString: assert.deepEqual(steamrollArray([1, [], [3, [[4]]]]), [1, 3, 4], '<code>steamrollArray([1, [], [3, [[4]]]])</code> should return <code>[1, 3, 4]</code>.');
|
||||
testString: assert.deepEqual(steamrollArray([1, [], [3, [[4]]]]), [1, 3, 4]);
|
||||
- text: <code>steamrollArray([1, {}, [3, [[4]]]])</code> should return <code>[1, {}, 3, 4]</code>.
|
||||
testString: assert.deepEqual(steamrollArray([1, {}, [3, [[4]]]]), [1, {}, 3, 4], '<code>steamrollArray([1, {}, [3, [[4]]]])</code> should return <code>[1, {}, 3, 4]</code>.');
|
||||
testString: assert.deepEqual(steamrollArray([1, {}, [3, [[4]]]]), [1, {}, 3, 4]);
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,15 +26,15 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>sumAll([1, 4])</code> should return a number.
|
||||
testString: assert(typeof sumAll([1, 4]) === 'number', '<code>sumAll([1, 4])</code> should return a number.');
|
||||
testString: assert(typeof sumAll([1, 4]) === 'number');
|
||||
- text: <code>sumAll([1, 4])</code> should return 10.
|
||||
testString: assert.deepEqual(sumAll([1, 4]), 10, '<code>sumAll([1, 4])</code> should return 10.');
|
||||
testString: assert.deepEqual(sumAll([1, 4]), 10);
|
||||
- text: <code>sumAll([4, 1])</code> should return 10.
|
||||
testString: assert.deepEqual(sumAll([4, 1]), 10, '<code>sumAll([4, 1])</code> should return 10.');
|
||||
testString: assert.deepEqual(sumAll([4, 1]), 10);
|
||||
- text: <code>sumAll([5, 10])</code> should return 45.
|
||||
testString: assert.deepEqual(sumAll([5, 10]), 45, '<code>sumAll([5, 10])</code> should return 45.');
|
||||
testString: assert.deepEqual(sumAll([5, 10]), 45);
|
||||
- text: <code>sumAll([10, 5])</code> should return 45.
|
||||
testString: assert.deepEqual(sumAll([10, 5]), 45, '<code>sumAll([10, 5])</code> should return 45.');
|
||||
testString: assert.deepEqual(sumAll([10, 5]), 45);
|
||||
|
||||
```
|
||||
|
||||
|
@ -24,17 +24,17 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>sumFibs(1)</code> should return a number.
|
||||
testString: assert(typeof sumFibs(1) === "number", '<code>sumFibs(1)</code> should return a number.');
|
||||
testString: assert(typeof sumFibs(1) === "number");
|
||||
- text: <code>sumFibs(1000)</code> should return 1785.
|
||||
testString: assert(sumFibs(1000) === 1785, '<code>sumFibs(1000)</code> should return 1785.');
|
||||
testString: assert(sumFibs(1000) === 1785);
|
||||
- text: <code>sumFibs(4000000)</code> should return 4613732.
|
||||
testString: assert(sumFibs(4000000) === 4613732, '<code>sumFibs(4000000)</code> should return 4613732.');
|
||||
testString: assert(sumFibs(4000000) === 4613732);
|
||||
- text: <code>sumFibs(4)</code> should return 5.
|
||||
testString: assert(sumFibs(4) === 5, '<code>sumFibs(4)</code> should return 5.');
|
||||
testString: assert(sumFibs(4) === 5);
|
||||
- text: <code>sumFibs(75024)</code> should return 60696.
|
||||
testString: assert(sumFibs(75024) === 60696, '<code>sumFibs(75024)</code> should return 60696.');
|
||||
testString: assert(sumFibs(75024) === 60696);
|
||||
- text: <code>sumFibs(75025)</code> should return 135721.
|
||||
testString: assert(sumFibs(75025) === 135721, '<code>sumFibs(75025)</code> should return 135721.');
|
||||
testString: assert(sumFibs(75025) === 135721);
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,9 +26,9 @@ tests:
|
||||
- text: <code>sumPrimes(10)</code> should return a number.
|
||||
testString: assert.deepEqual(typeof sumPrimes(10), 'number', '<code>sumPrimes(10)</code> should return a number.');
|
||||
- text: <code>sumPrimes(10)</code> should return 17.
|
||||
testString: assert.deepEqual(sumPrimes(10), 17, '<code>sumPrimes(10)</code> should return 17.');
|
||||
testString: assert.deepEqual(sumPrimes(10), 17);
|
||||
- text: <code>sumPrimes(977)</code> should return 73156.
|
||||
testString: assert.deepEqual(sumPrimes(977), 73156, '<code>sumPrimes(977)</code> should return 73156.');
|
||||
testString: assert.deepEqual(sumPrimes(977), 73156);
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,13 +25,13 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>rot13("SERR PBQR PNZC")</code> should decode to <code>FREE CODE CAMP</code>
|
||||
testString: assert(rot13("SERR PBQR PNZC") === "FREE CODE CAMP", '<code>rot13("SERR PBQR PNZC")</code> should decode to <code>FREE CODE CAMP</code>');
|
||||
testString: assert(rot13("SERR PBQR PNZC") === "FREE CODE CAMP");
|
||||
- text: <code>rot13("SERR CVMMN!")</code> should decode to <code>FREE PIZZA!</code>
|
||||
testString: assert(rot13("SERR CVMMN!") === "FREE PIZZA!", '<code>rot13("SERR CVMMN!")</code> should decode to <code>FREE PIZZA!</code>');
|
||||
testString: assert(rot13("SERR CVMMN!") === "FREE PIZZA!");
|
||||
- text: <code>rot13("SERR YBIR?")</code> should decode to <code>FREE LOVE?</code>
|
||||
testString: assert(rot13("SERR YBIR?") === "FREE LOVE?", '<code>rot13("SERR YBIR?")</code> should decode to <code>FREE LOVE?</code>');
|
||||
testString: assert(rot13("SERR YBIR?") === "FREE LOVE?");
|
||||
- text: <code>rot13("GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT.")</code> should decode to <code>THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.</code>
|
||||
testString: assert(rot13("GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT.") === "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.", '<code>rot13("GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT.")</code> should decode to <code>THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.</code>');
|
||||
testString: assert(rot13("GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT.") === "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.");
|
||||
|
||||
```
|
||||
|
||||
|
@ -26,31 +26,31 @@ Remember to use <a href="http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>palindrome("eye")</code> should return a boolean.
|
||||
testString: assert(typeof palindrome("eye") === "boolean", '<code>palindrome("eye")</code> should return a boolean.');
|
||||
testString: assert(typeof palindrome("eye") === "boolean");
|
||||
- text: <code>palindrome("eye")</code> should return true.
|
||||
testString: assert(palindrome("eye") === true, '<code>palindrome("eye")</code> should return true.');
|
||||
testString: assert(palindrome("eye") === true);
|
||||
- text: <code>palindrome("_eye")</code> should return true.
|
||||
testString: assert(palindrome("_eye") === true, '<code>palindrome("_eye")</code> should return true.');
|
||||
testString: assert(palindrome("_eye") === true);
|
||||
- text: <code>palindrome("race car")</code> should return true.
|
||||
testString: assert(palindrome("race car") === true, '<code>palindrome("race car")</code> should return true.');
|
||||
testString: assert(palindrome("race car") === true);
|
||||
- text: <code>palindrome("not a palindrome")</code> should return false.
|
||||
testString: assert(palindrome("not a palindrome") === false, '<code>palindrome("not a palindrome")</code> should return false.');
|
||||
testString: assert(palindrome("not a palindrome") === false);
|
||||
- text: <code>palindrome("A man, a plan, a canal. Panama")</code> should return true.
|
||||
testString: assert(palindrome("A man, a plan, a canal. Panama") === true, '<code>palindrome("A man, a plan, a canal. Panama")</code> should return true.');
|
||||
testString: assert(palindrome("A man, a plan, a canal. Panama") === true);
|
||||
- text: <code>palindrome("never odd or even")</code> should return true.
|
||||
testString: assert(palindrome("never odd or even") === true, '<code>palindrome("never odd or even")</code> should return true.');
|
||||
testString: assert(palindrome("never odd or even") === true);
|
||||
- text: <code>palindrome("nope")</code> should return false.
|
||||
testString: assert(palindrome("nope") === false, '<code>palindrome("nope")</code> should return false.');
|
||||
testString: assert(palindrome("nope") === false);
|
||||
- text: <code>palindrome("almostomla")</code> should return false.
|
||||
testString: assert(palindrome("almostomla") === false, '<code>palindrome("almostomla")</code> should return false.');
|
||||
testString: assert(palindrome("almostomla") === false);
|
||||
- text: <code>palindrome("My age is 0, 0 si ega ym.")</code> should return true.
|
||||
testString: assert(palindrome("My age is 0, 0 si ega ym.") === true, '<code>palindrome("My age is 0, 0 si ega ym.")</code> should return true.');
|
||||
testString: assert(palindrome("My age is 0, 0 si ega ym.") === true);
|
||||
- text: <code>palindrome("1 eye for of 1 eye.")</code> should return false.
|
||||
testString: assert(palindrome("1 eye for of 1 eye.") === false, '<code>palindrome("1 eye for of 1 eye.")</code> should return false.');
|
||||
testString: assert(palindrome("1 eye for of 1 eye.") === false);
|
||||
- text: '<code>palindrome("0_0 (: /-\ :) 0-0")</code> should return true.'
|
||||
testString: 'assert(palindrome("0_0 (: /-\ :) 0-0") === true, ''<code>palindrome("0_0 (: /-\ :) 0-0")</code> should return true.'');'
|
||||
- text: <code>palindrome("five|\_/|four")</code> should return false.
|
||||
testString: assert(palindrome("five|\_/|four") === false, '<code>palindrome("five|\_/|four")</code> should return false.');
|
||||
testString: assert(palindrome("five|\_/|four") === false);
|
||||
|
||||
```
|
||||
|
||||
|
@ -23,57 +23,57 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>convertToRoman(2)</code> should return "II".
|
||||
testString: assert.deepEqual(convertToRoman(2), "II", '<code>convertToRoman(2)</code> should return "II".');
|
||||
testString: assert.deepEqual(convertToRoman(2), "II");
|
||||
- text: <code>convertToRoman(3)</code> should return "III".
|
||||
testString: assert.deepEqual(convertToRoman(3), "III", '<code>convertToRoman(3)</code> should return "III".');
|
||||
testString: assert.deepEqual(convertToRoman(3), "III");
|
||||
- text: <code>convertToRoman(4)</code> should return "IV".
|
||||
testString: assert.deepEqual(convertToRoman(4), "IV", '<code>convertToRoman(4)</code> should return "IV".');
|
||||
testString: assert.deepEqual(convertToRoman(4), "IV");
|
||||
- text: <code>convertToRoman(5)</code> should return "V".
|
||||
testString: assert.deepEqual(convertToRoman(5), "V", '<code>convertToRoman(5)</code> should return "V".');
|
||||
testString: assert.deepEqual(convertToRoman(5), "V");
|
||||
- text: <code>convertToRoman(9)</code> should return "IX".
|
||||
testString: assert.deepEqual(convertToRoman(9), "IX", '<code>convertToRoman(9)</code> should return "IX".');
|
||||
testString: assert.deepEqual(convertToRoman(9), "IX");
|
||||
- text: <code>convertToRoman(12)</code> should return "XII".
|
||||
testString: assert.deepEqual(convertToRoman(12), "XII", '<code>convertToRoman(12)</code> should return "XII".');
|
||||
testString: assert.deepEqual(convertToRoman(12), "XII");
|
||||
- text: <code>convertToRoman(16)</code> should return "XVI".
|
||||
testString: assert.deepEqual(convertToRoman(16), "XVI", '<code>convertToRoman(16)</code> should return "XVI".');
|
||||
testString: assert.deepEqual(convertToRoman(16), "XVI");
|
||||
- text: <code>convertToRoman(29)</code> should return "XXIX".
|
||||
testString: assert.deepEqual(convertToRoman(29), "XXIX", '<code>convertToRoman(29)</code> should return "XXIX".');
|
||||
testString: assert.deepEqual(convertToRoman(29), "XXIX");
|
||||
- text: <code>convertToRoman(44)</code> should return "XLIV".
|
||||
testString: assert.deepEqual(convertToRoman(44), "XLIV", '<code>convertToRoman(44)</code> should return "XLIV".');
|
||||
testString: assert.deepEqual(convertToRoman(44), "XLIV");
|
||||
- text: <code>convertToRoman(45)</code> should return "XLV"
|
||||
testString: assert.deepEqual(convertToRoman(45), "XLV", '<code>convertToRoman(45)</code> should return "XLV"');
|
||||
testString: assert.deepEqual(convertToRoman(45), "XLV");
|
||||
- text: <code>convertToRoman(68)</code> should return "LXVIII"
|
||||
testString: assert.deepEqual(convertToRoman(68), "LXVIII", '<code>convertToRoman(68)</code> should return "LXVIII"');
|
||||
testString: assert.deepEqual(convertToRoman(68), "LXVIII");
|
||||
- text: <code>convertToRoman(83)</code> should return "LXXXIII"
|
||||
testString: assert.deepEqual(convertToRoman(83), "LXXXIII", '<code>convertToRoman(83)</code> should return "LXXXIII"');
|
||||
testString: assert.deepEqual(convertToRoman(83), "LXXXIII");
|
||||
- text: <code>convertToRoman(97)</code> should return "XCVII"
|
||||
testString: assert.deepEqual(convertToRoman(97), "XCVII", '<code>convertToRoman(97)</code> should return "XCVII"');
|
||||
testString: assert.deepEqual(convertToRoman(97), "XCVII");
|
||||
- text: <code>convertToRoman(99)</code> should return "XCIX"
|
||||
testString: assert.deepEqual(convertToRoman(99), "XCIX", '<code>convertToRoman(99)</code> should return "XCIX"');
|
||||
testString: assert.deepEqual(convertToRoman(99), "XCIX");
|
||||
- text: <code>convertToRoman(400)</code> should return "CD"
|
||||
testString: assert.deepEqual(convertToRoman(400), "CD", '<code>convertToRoman(400)</code> should return "CD"');
|
||||
testString: assert.deepEqual(convertToRoman(400), "CD");
|
||||
- text: <code>convertToRoman(500)</code> should return "D"
|
||||
testString: assert.deepEqual(convertToRoman(500), "D", '<code>convertToRoman(500)</code> should return "D"');
|
||||
testString: assert.deepEqual(convertToRoman(500), "D");
|
||||
- text: <code>convertToRoman(501)</code> should return "DI"
|
||||
testString: assert.deepEqual(convertToRoman(501), "DI", '<code>convertToRoman(501)</code> should return "DI"');
|
||||
testString: assert.deepEqual(convertToRoman(501), "DI");
|
||||
- text: <code>convertToRoman(649)</code> should return "DCXLIX"
|
||||
testString: assert.deepEqual(convertToRoman(649), "DCXLIX", '<code>convertToRoman(649)</code> should return "DCXLIX"');
|
||||
testString: assert.deepEqual(convertToRoman(649), "DCXLIX");
|
||||
- text: <code>convertToRoman(798)</code> should return "DCCXCVIII"
|
||||
testString: assert.deepEqual(convertToRoman(798), "DCCXCVIII", '<code>convertToRoman(798)</code> should return "DCCXCVIII"');
|
||||
testString: assert.deepEqual(convertToRoman(798), "DCCXCVIII");
|
||||
- text: <code>convertToRoman(891)</code> should return "DCCCXCI"
|
||||
testString: assert.deepEqual(convertToRoman(891), "DCCCXCI", '<code>convertToRoman(891)</code> should return "DCCCXCI"');
|
||||
testString: assert.deepEqual(convertToRoman(891), "DCCCXCI");
|
||||
- text: <code>convertToRoman(1000)</code> should return "M"
|
||||
testString: assert.deepEqual(convertToRoman(1000), "M", '<code>convertToRoman(1000)</code> should return "M"');
|
||||
testString: assert.deepEqual(convertToRoman(1000), "M");
|
||||
- text: <code>convertToRoman(1004)</code> should return "MIV"
|
||||
testString: assert.deepEqual(convertToRoman(1004), "MIV", '<code>convertToRoman(1004)</code> should return "MIV"');
|
||||
testString: assert.deepEqual(convertToRoman(1004), "MIV");
|
||||
- text: <code>convertToRoman(1006)</code> should return "MVI"
|
||||
testString: assert.deepEqual(convertToRoman(1006), "MVI", '<code>convertToRoman(1006)</code> should return "MVI"');
|
||||
testString: assert.deepEqual(convertToRoman(1006), "MVI");
|
||||
- text: <code>convertToRoman(1023)</code> should return "MXXIII"
|
||||
testString: assert.deepEqual(convertToRoman(1023), "MXXIII", '<code>convertToRoman(1023)</code> should return "MXXIII"');
|
||||
testString: assert.deepEqual(convertToRoman(1023), "MXXIII");
|
||||
- text: <code>convertToRoman(2014)</code> should return "MMXIV"
|
||||
testString: assert.deepEqual(convertToRoman(2014), "MMXIV", '<code>convertToRoman(2014)</code> should return "MMXIV"');
|
||||
testString: assert.deepEqual(convertToRoman(2014), "MMXIV");
|
||||
- text: <code>convertToRoman(3999)</code> should return "MMMCMXCIX"
|
||||
testString: assert.deepEqual(convertToRoman(3999), "MMMCMXCIX", '<code>convertToRoman(3999)</code> should return "MMMCMXCIX"');
|
||||
testString: assert.deepEqual(convertToRoman(3999), "MMMCMXCIX");
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,59 +25,59 @@ Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-yo
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>telephoneCheck("555-555-5555")</code> should return a boolean.
|
||||
testString: assert(typeof telephoneCheck("555-555-5555") === "boolean", '<code>telephoneCheck("555-555-5555")</code> should return a boolean.');
|
||||
testString: assert(typeof telephoneCheck("555-555-5555") === "boolean");
|
||||
- text: <code>telephoneCheck("1 555-555-5555")</code> should return true.
|
||||
testString: assert(telephoneCheck("1 555-555-5555") === true, '<code>telephoneCheck("1 555-555-5555")</code> should return true.');
|
||||
testString: assert(telephoneCheck("1 555-555-5555") === true);
|
||||
- text: <code>telephoneCheck("1 (555) 555-5555")</code> should return true.
|
||||
testString: assert(telephoneCheck("1 (555) 555-5555") === true, '<code>telephoneCheck("1 (555) 555-5555")</code> should return true.');
|
||||
testString: assert(telephoneCheck("1 (555) 555-5555") === true);
|
||||
- text: <code>telephoneCheck("5555555555")</code> should return true.
|
||||
testString: assert(telephoneCheck("5555555555") === true, '<code>telephoneCheck("5555555555")</code> should return true.');
|
||||
testString: assert(telephoneCheck("5555555555") === true);
|
||||
- text: <code>telephoneCheck("555-555-5555")</code> should return true.
|
||||
testString: assert(telephoneCheck("555-555-5555") === true, '<code>telephoneCheck("555-555-5555")</code> should return true.');
|
||||
testString: assert(telephoneCheck("555-555-5555") === true);
|
||||
- text: <code>telephoneCheck("(555)555-5555")</code> should return true.
|
||||
testString: assert(telephoneCheck("(555)555-5555") === true, '<code>telephoneCheck("(555)555-5555")</code> should return true.');
|
||||
testString: assert(telephoneCheck("(555)555-5555") === true);
|
||||
- text: <code>telephoneCheck("1(555)555-5555")</code> should return true.
|
||||
testString: assert(telephoneCheck("1(555)555-5555") === true, '<code>telephoneCheck("1(555)555-5555")</code> should return true.');
|
||||
testString: assert(telephoneCheck("1(555)555-5555") === true);
|
||||
- text: <code>telephoneCheck("555-5555")</code> should return false.
|
||||
testString: assert(telephoneCheck("555-5555") === false, '<code>telephoneCheck("555-5555")</code> should return false.');
|
||||
testString: assert(telephoneCheck("555-5555") === false);
|
||||
- text: <code>telephoneCheck("5555555")</code> should return false.
|
||||
testString: assert(telephoneCheck("5555555") === false, '<code>telephoneCheck("5555555")</code> should return false.');
|
||||
testString: assert(telephoneCheck("5555555") === false);
|
||||
- text: <code>telephoneCheck("1 555)555-5555")</code> should return false.
|
||||
testString: assert(telephoneCheck("1 555)555-5555") === false, '<code>telephoneCheck("1 555)555-5555")</code> should return false.');
|
||||
testString: assert(telephoneCheck("1 555)555-5555") === false);
|
||||
- text: <code>telephoneCheck("1 555 555 5555")</code> should return true.
|
||||
testString: assert(telephoneCheck("1 555 555 5555") === true, '<code>telephoneCheck("1 555 555 5555")</code> should return true.');
|
||||
testString: assert(telephoneCheck("1 555 555 5555") === true);
|
||||
- text: <code>telephoneCheck("1 456 789 4444")</code> should return true.
|
||||
testString: assert(telephoneCheck("1 456 789 4444") === true, '<code>telephoneCheck("1 456 789 4444")</code> should return true.');
|
||||
testString: assert(telephoneCheck("1 456 789 4444") === true);
|
||||
- text: <code>telephoneCheck("123**&!!asdf#")</code> should return false.
|
||||
testString: assert(telephoneCheck("123**&!!asdf#") === false, '<code>telephoneCheck("123**&!!asdf#")</code> should return false.');
|
||||
testString: assert(telephoneCheck("123**&!!asdf#") === false);
|
||||
- text: <code>telephoneCheck("55555555")</code> should return false.
|
||||
testString: assert(telephoneCheck("55555555") === false, '<code>telephoneCheck("55555555")</code> should return false.');
|
||||
testString: assert(telephoneCheck("55555555") === false);
|
||||
- text: <code>telephoneCheck("(6054756961)")</code> should return false
|
||||
testString: assert(telephoneCheck("(6054756961)") === false, '<code>telephoneCheck("(6054756961)")</code> should return false');
|
||||
testString: assert(telephoneCheck("(6054756961)") === false);
|
||||
- text: <code>telephoneCheck("2 (757) 622-7382")</code> should return false.
|
||||
testString: assert(telephoneCheck("2 (757) 622-7382") === false, '<code>telephoneCheck("2 (757) 622-7382")</code> should return false.');
|
||||
testString: assert(telephoneCheck("2 (757) 622-7382") === false);
|
||||
- text: <code>telephoneCheck("0 (757) 622-7382")</code> should return false.
|
||||
testString: assert(telephoneCheck("0 (757) 622-7382") === false, '<code>telephoneCheck("0 (757) 622-7382")</code> should return false.');
|
||||
testString: assert(telephoneCheck("0 (757) 622-7382") === false);
|
||||
- text: <code>telephoneCheck("-1 (757) 622-7382")</code> should return false
|
||||
testString: assert(telephoneCheck("-1 (757) 622-7382") === false, '<code>telephoneCheck("-1 (757) 622-7382")</code> should return false');
|
||||
testString: assert(telephoneCheck("-1 (757) 622-7382") === false);
|
||||
- text: <code>telephoneCheck("2 757 622-7382")</code> should return false.
|
||||
testString: assert(telephoneCheck("2 757 622-7382") === false, '<code>telephoneCheck("2 757 622-7382")</code> should return false.');
|
||||
testString: assert(telephoneCheck("2 757 622-7382") === false);
|
||||
- text: <code>telephoneCheck("10 (757) 622-7382")</code> should return false.
|
||||
testString: assert(telephoneCheck("10 (757) 622-7382") === false, '<code>telephoneCheck("10 (757) 622-7382")</code> should return false.');
|
||||
testString: assert(telephoneCheck("10 (757) 622-7382") === false);
|
||||
- text: <code>telephoneCheck("27576227382")</code> should return false.
|
||||
testString: assert(telephoneCheck("27576227382") === false, '<code>telephoneCheck("27576227382")</code> should return false.');
|
||||
testString: assert(telephoneCheck("27576227382") === false);
|
||||
- text: <code>telephoneCheck("(275)76227382")</code> should return false.
|
||||
testString: assert(telephoneCheck("(275)76227382") === false, '<code>telephoneCheck("(275)76227382")</code> should return false.');
|
||||
testString: assert(telephoneCheck("(275)76227382") === false);
|
||||
- text: <code>telephoneCheck("2(757)6227382")</code> should return false.
|
||||
testString: assert(telephoneCheck("2(757)6227382") === false, '<code>telephoneCheck("2(757)6227382")</code> should return false.');
|
||||
testString: assert(telephoneCheck("2(757)6227382") === false);
|
||||
- text: <code>telephoneCheck("2(757)622-7382")</code> should return false.
|
||||
testString: assert(telephoneCheck("2(757)622-7382") === false, '<code>telephoneCheck("2(757)622-7382")</code> should return false.');
|
||||
testString: assert(telephoneCheck("2(757)622-7382") === false);
|
||||
- text: <code>telephoneCheck("555)-555-5555")</code> should return false.
|
||||
testString: assert(telephoneCheck("555)-555-5555") === false, '<code>telephoneCheck("555)-555-5555")</code> should return false.');
|
||||
testString: assert(telephoneCheck("555)-555-5555") === false);
|
||||
- text: <code>telephoneCheck("(555-555-5555")</code> should return false.
|
||||
testString: assert(telephoneCheck("(555-555-5555") === false, '<code>telephoneCheck("(555-555-5555")</code> should return false.');
|
||||
testString: assert(telephoneCheck("(555-555-5555") === false);
|
||||
- text: <code>telephoneCheck("(555)5(55?)-5555")</code> should return false.
|
||||
testString: assert(telephoneCheck("(555)5(55?)-5555") === false, '<code>telephoneCheck("(555)5(55?)-5555")</code> should return false.');
|
||||
testString: assert(telephoneCheck("(555)5(55?)-5555") === false);
|
||||
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user