diff --git a/challenges/advanced-bonfires.json b/challenges/advanced-bonfires.json index e14504dba4..978ebe81ce 100644 --- a/challenges/advanced-bonfires.json +++ b/challenges/advanced-bonfires.json @@ -230,7 +230,7 @@ "permAlone('aab');" ], "tests": [ - "expect(permAlone('aab')).to.be.a.number;", + "expect(permAlone('aab')).to.be.a('number');", "expect(permAlone('aab')).to.equal(2);", "expect(permAlone('aaa')).to.equal(0);", "expect(permAlone('aabb')).to.equal(8);", diff --git a/challenges/basic-bonfires.json b/challenges/basic-bonfires.json index df4b6bc16c..6c8952a980 100644 --- a/challenges/basic-bonfires.json +++ b/challenges/basic-bonfires.json @@ -180,7 +180,8 @@ "assert.deepEqual(palindrome(\"not a palindrome\"), false);", "assert.deepEqual(palindrome(\"A man, a plan, a canal. Panama\"), true);", "assert.deepEqual(palindrome(\"never odd or even\"), true);", - "assert.deepEqual(palindrome(\"nope\"), false);" + "assert.deepEqual(palindrome(\"nope\"), false);", + "assert.deepEqual(palindrome(\"almostomla\"), false);" ], "challengeSeed": [ "function palindrome(str) {", @@ -422,6 +423,7 @@ ], "tests": [ "expect(truncate('A-tisket a-tasket A green and yellow basket', 11)).to.eqls('A-tisket...');", + "expect(truncate('Peter Piper picked a peck of pickled peppers', 14)).to.eqls('Peter Piper...');", "assert(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length) === 'A-tisket a-tasket A green and yellow basket', 'should not truncate if string is = length');", "assert.strictEqual(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2), 'A-tisket a-tasket A green and yellow basket', 'should not truncate if string is < length');" ], @@ -656,7 +658,10 @@ ], "tests": [ "assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1], 'should remove correct values from an array');", - "assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], 'should remove correct values from an array');" + "assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], 'should remove correct values from an array');", + "assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1], 'should accept more than two additional arguments');", + "assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), [], 'should remove correct values from an array');", + "assert.deepEqual(destroyer(['tree', 'hamburger', 53], 'tree', 53), ['hamburger'], 'should handle NaN-elements');" ], "MDNlinks": [ "Arguments object", @@ -754,8 +759,8 @@ }, { "id": "a5de63ebea8dbee56860f4f2", - "name": "bonfire-diff-two-arrays", - "dashedName": "Bonfire: Diff Two Arrays", + "name": "Bonfire: Diff Two Arrays", + "dashedName": "bonfire-diff-two-arrays", "difficulty": "2.01", "description": [ "Compare two arrays and return a new array with any items not found in both of the original arrays.", @@ -853,7 +858,7 @@ "difficulty": "2.03", "description": [ "Perform a search and replace on the sentence using the arguments provided and return the new sentence.", - "First argument is the sentence the perform the search and replace on.", + "First argument is the sentence to perform the search and replace on.", "Second argument is the word that you will be replacing (before).", "Third argument is what you will be replacing the second argument with (after).", "NOTE: Preserve the case of the original word when you are replacing it. For example if you mean to replace the word 'Book' with the word 'dog', it should be replaced as 'Dog'", @@ -990,7 +995,8 @@ "expect(fearNotLetter('yz')).to.be.undefined;" ], "MDNlinks": [ - "String.charCodeAt()" + "String.charCodeAt()", + "String.fromCharCode()" ], "challengeType": 5, "nameCn": "", @@ -1104,6 +1110,10 @@ ], "tests": [ "assert.strictEqual(convert('Dolce & Gabbana'), 'Dolce & Gabbana', 'should escape characters');", + "assert.strictEqual(convert('Hamburgers < Pizza < Tacos'), 'Hamburgers < Pizza < Tacos', 'should escape characters');", + "assert.strictEqual(convert('Sixty > twelve'), 'Sixty > twelve', 'should escape characters');", + "assert.strictEqual(convert('Stuff in \"quotation marks\"'), 'Stuff in "quotation marks"', 'should escape characters');", + "assert.strictEqual(convert(\"Shindler's List\"), 'Shindler's List', 'should escape characters');", "assert.strictEqual(convert('abc'), 'abc', 'should handle strings with nothing to escape');" ], "MDNlinks": [ diff --git a/challenges/basic-html5-and-css.json b/challenges/basic-html5-and-css.json index 60c5ca0b6f..52bd6f49b2 100644 --- a/challenges/basic-html5-and-css.json +++ b/challenges/basic-html5-and-css.json @@ -974,7 +974,7 @@ "assert($('img').hasClass('thick-green-border'), 'Your img element should have the class \"thick-green-border\".')", "assert($('img').hasClass('thick-green-border') && parseInt($('img').css('border-top-width')), 'Give your image a border width of 10px.')", "assert(new RegExp('solid', 'gi').test(editor), 'Give your image a border style of \"solid\".')", - "assert($('img').css('border-left-color') === 'rgb(0, 128, 0)', 'Your img element should be green.')" + "assert($('img').css('border-left-color') === 'rgb(0, 128, 0)', 'The border around your img element should be green.')" ], "challengeSeed": [ "", @@ -1165,7 +1165,7 @@ ], "tests": [ "assert((/cat photos/gi).test($('a').text()), 'Your a element should have the anchor text of \"cat photos\"')", - "assert($('a').filter(function(index) { return /com/gi.test($('a').attr('href')); }).length > 0, 'You need an a element that links to http://catphotoapp.com.')", + "assert(/http:\\/\\/catphotoapp\\.com/gi.test($('a').attr('href')), 'You need an a element that links to http://catphotoapp.com.')", "assert(editor.match(/<\\/a>/g) && editor.match(/<\\/a>/g).length === editor.match(/a element has a closing tag.')" ], "challengeSeed": [ diff --git a/challenges/bootstrap.json b/challenges/bootstrap.json index eeac669f73..9f2b704153 100644 --- a/challenges/bootstrap.json +++ b/challenges/bootstrap.json @@ -626,7 +626,7 @@ "The \"row\" class is applied to a div, and the buttons themselves can be wrapped within it." ], "tests": [ - "assert($('div.row:has(button)'), 'Your buttons should all be wrapped within the same div element with the class \"row\".')", + "assert($('div.row:has(button)').length > 0, 'Your buttons should all be wrapped within the same div element with the class \"row\".')", "assert($('div.col-xs-4:has(button)').length > 2, 'Each of your Bootstrap buttons should be wrapped within its own a div element with the class \"col-xs-4\".')", "assert(editor.match(/<\\/button>/g) && editor.match(/