From b4afc3430a0c364242fc1399fcf2e64b1bf53e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADnez?= Date: Sun, 16 Aug 2015 21:11:36 +0000 Subject: [PATCH 001/282] Fixed #1090 --- seed/challenges/html5-and-css.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/challenges/html5-and-css.json b/seed/challenges/html5-and-css.json index 4d4ae95cad..e25c317578 100644 --- a/seed/challenges/html5-and-css.json +++ b/seed/challenges/html5-and-css.json @@ -867,8 +867,8 @@ "tests": [ "assert($(\"img\").hasClass(\"smaller-image\"), 'Your img element should have the class smaller-image.')", "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\").hasClass(\"thick-green-border\") && parseInt($(\"img\").css(\"border-top-width\"), 10) === 10, 'Give your image a border width of 10px.')", + "assert($(\"img\").css(\"border-right-style\") === \"solid\", 'Give your image a border style of solid.')", "assert($(\"img\").css(\"border-left-color\") === \"rgb(0, 128, 0)\", 'The border around your img element should be green.')" ], "challengeSeed": [ From 2fade59319e08b26941261ecbbbd7206b0fe23e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADnez?= Date: Mon, 17 Aug 2015 16:01:51 +0000 Subject: [PATCH 002/282] Changed test case for Waypoint: target elements by id --- seed/challenges/jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index f2dfcb08e1..cd059066b1 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -161,7 +161,7 @@ ], "tests": [ "assert($(\"#target3\").hasClass(\"animated\"), 'Select the buttonelement with the id of target3 and use the jQuery addClass() function to give it the class of animated.');", - "assert($(\"#target3\").hasClass(\"fadeOut\") || $(\"#target3\").hasClass(\"fadeout\"), 'Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.')", + "assert(($(\"#target3\").hasClass(\"fadeOut\") || $(\"#target3\").hasClass(\"fadeout\")) && editor.match(/\\$\\(.#target3.\\)/g), 'Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.');", "assert(!editor.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.')" ], "challengeSeed": [ From 8e705b14ecd649f62eae6d862bf97b3f2783efcd Mon Sep 17 00:00:00 2001 From: Ionut Costica Date: Wed, 19 Aug 2015 15:43:39 +0300 Subject: [PATCH 003/282] Fix for Issue #2179, #2141, #2077, #1999 Fixes #2179, #2141, #2077, #1999 --- seed/challenges/basic-javascript.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index 1096e02868..de249f003a 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -16,9 +16,9 @@ "Try creating one of each." ], "tests":[ - "assert(editor.getValue().match(/(\\/\\/)...../g), 'Create a \\/\\/ style comment that contains at least five letters');", - "assert(editor.getValue().match(/(\\/\\*)...../g), 'Create a \/\\* \\*\/ style comment that contains at least five letters.');", - "assert(editor.getValue().match(/(\\*\\/)/g), 'Make sure that you close the comment with a \\*\/');" + "assert(editor.getValue().match(/(\\/\\/)...../g), 'Create a // style comment that contains at least five letters');", + "assert(editor.getValue().match(/(\\/\\*)[\\w\\W]{5,}(?=\\*\\/)/gm), 'Create a /* */ style comment that contains at least five letters.');", + "assert(editor.getValue().match(/(\\*\\/)/g), 'Make sure that you close the comment with a */');" ], "challengeSeed":[ ], From 23139ff45fbe0a936fff2d8d9e927b1fb3bce5c4 Mon Sep 17 00:00:00 2001 From: Mark Surnin Date: Thu, 20 Aug 2015 12:01:38 +0500 Subject: [PATCH 004/282] Added a test for factorial(0) to be equal to 1. --- seed/challenges/basic-bonfires.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index 6f1cf7b9d4..84f92e15dd 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -90,7 +90,8 @@ "expect(factorialize(5)).to.be.a(\"Number\");", "expect(factorialize(5)).to.equal(120);", "expect(factorialize(10)).to.equal(3628800);", - "expect(factorialize(20)).to.equal(2432902008176640000);" + "expect(factorialize(20)).to.equal(2432902008176640000);", + "expect(factorialize(0)).to.equal(1);" ], "difficulty": "1.02", "description": [ From 636e16d5221fb59414875a89dffcdd4417a47cd3 Mon Sep 17 00:00:00 2001 From: Ionut Costica Date: Fri, 21 Aug 2015 15:18:40 +0300 Subject: [PATCH 005/282] [Waypoint: Remove Classes from an element with jQuery] usually expected to not validate if using removeClass() without parameters Added extra test to the waypoint to check if `.removeClass` was used with the `"btn-default"` parameter as most people expect to have to do (and are confused when the code validates before they've finished writing their function, as seen by the myriad of issues opened about it). Closes #2302 Closes #2402 Closes #2301 Closes #2197 Closes #2160 Closes #1923 Closes #1898 --- seed/challenges/jquery.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index aecaf645a6..99a8984a85 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -314,7 +314,8 @@ ], "tests": [ "assert($(\".btn-default\").length === 0, 'Remove the btn-default class from all of your button elements.')", - "assert(editor.match(/btn btn-default/g), 'Only use jQuery to remove this class from the element.')" + "assert(editor.match(/btn btn-default/g), 'Only use jQuery to remove this class from the element.')", + "assert(editor.match(/\\.[\\v\\s]*removeClass[\\s\\v]*\\([\\s\\v]*('|\")\\s*btn-default\\s*('|\")[\\s\\v]*\\)/gm), 'Only remove the btn-default class.'" ], "challengeSeed": [ "fccss", From 0132a1afcae227ea80934ae61e64e0c7d2c81bc5 Mon Sep 17 00:00:00 2001 From: Jakob Dahl Date: Fri, 21 Aug 2015 17:45:30 +0200 Subject: [PATCH 006/282] 2324 for id attributes to be under relevant parents --- seed/challenges/bootstrap.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/seed/challenges/bootstrap.json b/seed/challenges/bootstrap.json index da7a510236..a447d6bffa 100644 --- a/seed/challenges/bootstrap.json +++ b/seed/challenges/bootstrap.json @@ -1949,8 +1949,8 @@ "Give the well on the left the id of left-well. Give the well on the right the id of right-well." ], "tests": [ - "assert($(\"#left-well\") && $(\"#left-well\").length > 0, 'Give your left well the id of left-well.')", - "assert($(\"#right-well\") && $(\"#right-well\").length > 0, 'Give your right well the id of right-well.')" + "assert($(\".col-xs-6\").children(\"#left-well\") && $(\".col-xs-6\").children(\"#left-well\").length > 0, 'Give your left well the id of left-well.')", + "assert($(\".col-xs-6\").children(\"#right-well\") && $(\".col-xs-6\").children(\"#right-well\").length > 0, 'Give your right well the id of right-well.')" ], "challengeSeed": [ "
", @@ -2046,12 +2046,12 @@ "Give each of your buttons a unique id like, starting with target1 and ending with target6." ], "tests": [ - "assert($(\"#target1\") && $(\"#target1\").length > 0, 'One button element should have the id target1.')", - "assert($(\"#target2\") && $(\"#target2\").length > 0, 'One button element should have the id target2.')", - "assert($(\"#target3\") && $(\"#target3\").length > 0, 'One button element should have the id target3.')", - "assert($(\"#target4\") && $(\"#target4\").length > 0, 'One button element should have the id target4.')", - "assert($(\"#target5\") && $(\"#target5\").length > 0, 'One button element should have the id target5.')", - "assert($(\"#target6\") && $(\"#target6\").length > 0, 'One button element should have the id target6.')" + "assert($(\"#left-well\").children(\"#target1\") && $(\"#left-well\").children(\"#target1\").length > 0, 'One button element should have the id target1.')", + "assert($(\"#left-well\").children(\"#target2\") && $(\"#left-well\").children(\"#target2\").length > 0, 'One button element should have the id target2.')", + "assert($(\"#left-well\").children(\"#target3\") && $(\"#left-well\").children(\"#target3\").length > 0, 'One button element should have the id target3.')", + "assert($(\"#right-well\").children(\"#target4\") && $(\"#right-well\").children(\"#target4\").length > 0, 'One button element should have the id target4.')", + "assert($(\"#right-well\").children(\"#target5\") && $(\"#right-well\").children(\"#target5\").length > 0, 'One button element should have the id target5.')", + "assert($(\"#right-well\").children(\"#target6\") && $(\"#right-well\").children(\"#target6\").length > 0, 'One button element should have the id target6.')" ], "challengeSeed": [ "
", From 67158e876db1da0ed05dddd9e5557ee840b676b1 Mon Sep 17 00:00:00 2001 From: ahstro Date: Sun, 23 Aug 2015 15:18:17 +0200 Subject: [PATCH 007/282] Check all children instead of just one in 'Target Children with jQuery' --- seed/challenges/jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index 8576e4bc0d..75de836abf 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -679,7 +679,7 @@ "Here's an example of how you would use the children() function: $(\"#left-well\").children().css(\"color\", \"blue\")" ], "tests": [ - "assert($(\"#target6\").css(\"color\") === 'rgb(0, 128, 0)', 'Your target6 element should have green text.')", + "assert($(\"#right-well\").children().css(\"color\") === 'rgb(0, 128, 0)', 'All children of #right-well should have green text.')", "assert(editor.match(/\\.children\\(\\)\\.css/g), 'You should use the children() function to modify these elements.')", "assert(editor.match(/
/g), 'Only use jQuery to add these classes to the element.')" ], From 59bb244286dd514748ba22b6277969e709fdc0c0 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Sun, 23 Aug 2015 13:10:30 -0700 Subject: [PATCH 008/282] start refactoring bonfire tests --- seed/challenges/basic-bonfires.json | 172 ++++++++++++++-------------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index 539ce1d349..6ec7aa958b 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -13,8 +13,8 @@ "Make this function return true no matter what." ], "tests": [ - "expect(meetBonfire()).to.be.a(\"boolean\");", - "expect(meetBonfire()).to.be.true;" + "assert(typeof(meetBonfire()) === \"boolean\", 'The result should be a Boolean value of true or false.');", + "assert(meetBonfire() === true, 'Your meetBonfire() function should return true.');" ], "challengeSeed": [ "function meetBonfire(argument) {", @@ -46,10 +46,10 @@ "title": "Reverse a String", "difficulty": "1.01", "tests": [ - "expect(reverseString('hello')).to.be.a('String');", - "expect(reverseString('hello')).to.equal('olleh');", - "expect(reverseString('Howdy')).to.equal('ydwoH');", - "expect(reverseString('Greetings from Earth')).to.equal('htraE morf sgniteerG');" + "assert(typeof(reverseString('hello')) === \"string\", 'reverseString() should return a string.');", + "assert(reverseString('hello') === 'olleh', '\"hello\" should become \"olleh\".');", + "assert(reverseString('Howdy') === 'ydwoH', '\"Howdy\" should become \"ydwoH\".');", + "assert(reverseString('Greetings from Earth') === 'htraE morf sgniteerG', '\"Greetings from Earth\" should return \"htraE morf sgniteerG\".');" ], "description": [ "Reverse the provided string.", @@ -62,7 +62,7 @@ " return str;", "}", "", - "reverseString('hello');" + "reverseString('hello', '');" ], "MDNlinks": [ "Global String Object", @@ -87,10 +87,10 @@ "id": "a302f7aae1aa3152a5b413bc", "title": "Factorialize a Number", "tests": [ - "expect(factorialize(5)).to.be.a(\"Number\");", - "expect(factorialize(5)).to.equal(120);", - "expect(factorialize(10)).to.equal(3628800);", - "expect(factorialize(20)).to.equal(2432902008176640000);" + "assert(typeof(factorialize(5)) === \"number\", 'factorialize() should return a number.');", + "assert(factorialize(5) === 120, '5 should return 120.');", + "assert(factorialize(10) === 3628800, '10 should return 3,628,800.');", + "assert(factorialize(20) === 2432902008176640000, '20 should return 2,432,902,008,176,640,000.');" ], "difficulty": "1.02", "description": [ @@ -105,7 +105,7 @@ " return num;", "}", "", - "factorialize(5);" + "factorialize(5, '');" ], "MDNlinks": [ "Arithmetic Operators" @@ -135,14 +135,14 @@ "Remember to use Read-Search-Ask if you get stuck. Write your own code." ], "tests": [ - "expect(palindrome(\"eye\")).to.be.a(\"boolean\");", - "assert.deepEqual(palindrome(\"eye\"), true);", - "assert.deepEqual(palindrome(\"race car\"), true);", - "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(\"almostomla\"), false);" + "assert(palindrome(\"eye\")) === \"boolean\", '');", + "assert.deepEqual(palindrome(\"eye\"), true, '');", + "assert.deepEqual(palindrome(\"race car\"), true, '');", + "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(\"almostomla\"), false, '');" ], "challengeSeed": [ "function palindrome(str) {", @@ -152,7 +152,7 @@ "", "", "", - "palindrome(\"eye\");" + "palindrome(\"eye\", '');" ], "MDNlinks": [ "String.replace()", @@ -185,15 +185,15 @@ " return str.length;", "}", "", - "findLongestWord('The quick brown fox jumped over the lazy dog');" + "findLongestWord('The quick brown fox jumped over the lazy dog', '');" ], "tests": [ - "expect(findLongestWord('The quick brown fox jumped over the lazy dog')).to.be.a('Number');", - "expect(findLongestWord('The quick brown fox jumped over the lazy dog')).to.equal(6);", - "expect(findLongestWord('May the force be with you')).to.equal(5);", - "expect(findLongestWord('Google do a barrel roll')).to.equal(6);", - "expect(findLongestWord('What is the average airspeed velocity of an unladen swallow')).to.equal(8);", - "expect(findLongestWord('What if we try a super-long word such as otorhinolaryngology')).to.equal(19);" + "assert(findLongestWord('The quick brown fox jumped over the lazy dog')) === 'Number', '');", + "assert(findLongestWord('The quick brown fox jumped over the lazy dog') === 6, '');", + "assert(findLongestWord('May the force be with you') === 5, '');", + "assert(findLongestWord('Google do a barrel roll') === 6, '');", + "assert(findLongestWord('What is the average airspeed velocity of an unladen swallow') === 8, '');", + "assert(findLongestWord('What if we try a super-long word such as otorhinolaryngology') === 19, '');" ], "MDNlinks": [ "String.split()", @@ -226,13 +226,13 @@ " return str;", "}", "", - "titleCase(\"I'm a little tea pot\");" + "titleCase(\"I'm a little tea pot\", '');" ], "tests": [ - "expect(titleCase(\"I'm a little tea pot\")).to.be.a('String');", - "expect(titleCase(\"I'm a little tea pot\")).to.equal(\"I'm A Little Tea Pot\");", - "expect(titleCase(\"sHoRt AnD sToUt\")).to.equal(\"Short And Stout\");", - "expect(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\")).to.equal(\"Here Is My Handle Here Is My Spout\");" + "assert(titleCase(\"I'm a little tea pot\")) === 'String', '');", + "assert(titleCase(\"I'm a little tea pot\") === \"I'm A Little Tea Pot\", '');", + "assert(titleCase(\"sHoRt AnD sToUt\") === \"Short And Stout\", '');", + "assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", '');" ], "MDNlinks": [ "String.charAt()" @@ -266,12 +266,12 @@ " return arr;", "}", "", - "largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);" + "largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]], '');" ], "tests": [ - "expect(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])).to.be.a('array');", - "(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])).should.eql([27,5,39,1001]);", - "assert(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]).should.eql([9,35,97,1000000]));" + "assert(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])) === 'array', '');", + "(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])).should.eql([27,5,39,1001], '');", + "assert(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]).should.eql([9,35,97,1000000]), '');" ], "MDNlinks": [ "Comparison Operators" @@ -304,14 +304,14 @@ " return str;", "}", "", - "end('Bastian', 'n');" + "end('Bastian', 'n', '');" ], "tests": [ - "assert.strictEqual(end('Bastian', 'n'), true, 'should equal true if target equals end of string');", - "assert.strictEqual(end('Connor', 'n'), false, 'should equal false if target does not equal end of string');", - "assert.strictEqual(end('Walking on water and developing software from a specification are easy if both are frozen.', 'specification'), false, 'should equal false if target does not equal end of string');", - "assert.strictEqual(end('He has to give me a new name', 'name'), true, 'should equal true if target equals end of string');", - "assert.strictEqual(end('If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing', 'mountain'), false, 'should equal false if target does not equal end of string');" + "assert.strictEqual(end('Bastian', 'n'), true, 'should equal true if target equals end of string', '');", + "assert.strictEqual(end('Connor', 'n'), false, 'should equal false if target does not equal end of string', '');", + "assert.strictEqual(end('Walking on water and developing software from a specification are easy if both are frozen.', 'specification'), false, 'should equal false if target does not equal end of string', '');", + "assert.strictEqual(end('He has to give me a new name', 'name'), true, 'should equal true if target equals end of string', '');", + "assert.strictEqual(end('If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing', 'mountain'), false, 'should equal false if target does not equal end of string', '');" ], "MDNlinks": [ "String.substr()" @@ -343,12 +343,12 @@ " return str;", "}", "", - "repeat('abc', 3);" + "repeat('abc', 3, '');" ], "tests": [ - "assert.strictEqual(repeat('*', 3), '***', 'should repeat a string n times');", - "assert.strictEqual(repeat('abc', 3), 'abcabcabc', 'should repeat a string n times');", - "assert.strictEqual(repeat('abc', -2), '', 'should return an empty string for negative numbers');" + "assert.strictEqual(repeat('*', 3), '***', 'should repeat a string n times', '');", + "assert.strictEqual(repeat('abc', 3), 'abcabcabc', 'should repeat a string n times', '');", + "assert.strictEqual(repeat('abc', -2), '', 'should return an empty string for negative numbers', '');" ], "MDNlinks": [ "Global String Object" @@ -381,13 +381,13 @@ " return str;", "}", "", - "truncate('A-tisket a-tasket A green and yellow basket', 11);" + "truncate('A-tisket a-tasket A green and yellow basket', 11, '');" ], "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');" + "assert(truncate('A-tisket a-tasket A green and yellow basket', 11)).to.eqls('A-tisket...', '');", + "assert(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', '');" ], "MDNlinks": [ "String.slice()" @@ -419,13 +419,13 @@ " return arr;", "}", "", - "chunk(['a', 'b', 'c', 'd'], 2);" + "chunk(['a', 'b', 'c', 'd'], 2, '');" ], "tests": [ - "assert.deepEqual(chunk(['a', 'b', 'c', 'd'], 2), [['a', 'b'], ['c', 'd']], 'should return chunked arrays');", - "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'should return chunked arrays');", - "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], 'should return chunked arrays');", - "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'should return the last chunk as remaining elements');" + "assert.deepEqual(chunk(['a', 'b', 'c', 'd'], 2), [['a', 'b'], ['c', 'd']], 'should return chunked arrays', '');", + "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'should return chunked arrays', '');", + "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], 'should return chunked arrays', '');", + "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'should return the last chunk as remaining elements', '');" ], "MDNlinks": [ "Array.push()" @@ -457,12 +457,12 @@ " return arr;", "}", "", - "slasher([1, 2, 3], 2);" + "slasher([1, 2, 3], 2, '');" ], "tests": [ - "assert.deepEqual(slasher([1, 2, 3], 2), [3], 'should drop the first two elements');", - "assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], 'should return all elements');", - "assert.deepEqual(slasher([1, 2, 3], 9), [], 'should return an empty array');" + "assert.deepEqual(slasher([1, 2, 3], 2), [3], 'should drop the first two elements', '');", + "assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], 'should return all elements', '');", + "assert.deepEqual(slasher([1, 2, 3], 9), [], 'should return an empty array', '');" ], "MDNlinks": [ "Array.slice()", @@ -497,17 +497,17 @@ " return arr;", "}", "", - "mutation(['hello', 'hey']);" + "mutation(['hello', 'hey'], '');" ], "tests": [ - "expect(mutation(['hello', 'hey'])).to.be.false;", - "expect(mutation(['hello', 'Hello'])).to.be.true;", - "expect(mutation(['zyxwvutsrqponmlkjihgfedcba', 'qrstu'])).to.be.true;", - "expect(mutation(['Mary', 'Army'])).to.be.true;", - "expect(mutation(['Mary', 'Aarmy'])).to.be.true;", - "expect(mutation(['Alien', 'line'])).to.be.true;", - "expect(mutation(['floor', 'for'])).to.be.true;", - "expect(mutation(['hello', 'neo'])).to.be.false;" + "assert(mutation(['hello', 'hey'])).to.be.false;", + "assert(mutation(['hello', 'Hello'])).to.be.true;", + "assert(mutation(['zyxwvutsrqponmlkjihgfedcba', 'qrstu'])).to.be.true;", + "assert(mutation(['Mary', 'Army'])).to.be.true;", + "assert(mutation(['Mary', 'Aarmy'])).to.be.true;", + "assert(mutation(['Alien', 'line'])).to.be.true;", + "assert(mutation(['floor', 'for'])).to.be.true;", + "assert(mutation(['hello', 'neo'])).to.be.false;" ], "MDNlinks": [ "Array.indexOf()" @@ -540,12 +540,12 @@ " return arr;", "}", "", - "bouncer([7, 'ate', '', false, 9]);" + "bouncer([7, 'ate', '', false, 9], '');" ], "tests": [ - "assert.deepEqual(bouncer([7, 'ate', '', false, 9]), [7, 'ate', 9], 'should remove falsey values');", - "assert.deepEqual(bouncer(['a', 'b', 'c']), ['a', 'b', 'c'], 'should return full array if no falsey elements');", - "assert.deepEqual(bouncer([false, null, 0]), [], 'should return empty array if all elements are falsey');" + "assert.deepEqual(bouncer([7, 'ate', '', false, 9]), [7, 'ate', 9], 'should remove falsey values', '');", + "assert.deepEqual(bouncer(['a', 'b', 'c']), ['a', 'b', 'c'], 'should return full array if no falsey elements', '');", + "assert.deepEqual(bouncer([false, null, 0]), [], 'should return empty array if all elements are falsey', '');" ], "MDNlinks": [ "Boolean Objects", @@ -579,11 +579,11 @@ " return arr;", "}", "", - "where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });" + "where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }, '');" ], "tests": [ - "assert.deepEqual(where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }), [{ first: 'Tybalt', last: 'Capulet' }], 'should return an array of objects');", - "assert.deepEqual(where([{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], { 'a': 1 }), [{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], 'should return with multiples');" + "assert.deepEqual(where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }), [{ first: 'Tybalt', last: 'Capulet' }], 'should return an array of objects', '');", + "assert.deepEqual(where([{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], { 'a': 1 }), [{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], 'should return with multiples', '');" ], "MDNlinks": [ "Global Object", @@ -617,14 +617,14 @@ " return arr;", "}", "", - "destroyer([1, 2, 3, 1, 2, 3], 2, 3);" + "destroyer([1, 2, 3, 1, 2, 3], 2, 3, '');" ], "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([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');" + "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([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", @@ -658,14 +658,14 @@ " return num;", "}", "", - "where([40, 60], 50);" + "where([40, 60], 50, '');" ], "MDNlinks": [ "Array.sort()" ], "tests": [ - "expect(where([10, 20, 30, 40, 50], 35)).to.equal(3);", - "expect(where([10, 20, 30, 40, 50], 30)).to.equal(2);" + "assert(where([10, 20, 30, 40, 50], 35) === 3, '');", + "assert(where([10, 20, 30, 40, 50], 30) === 2, '');" ], "type": "bonfire", "challengeType": 5, From e4896eb0c0c95dd4fd7e4299c40ab490a6e32c24 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Sun, 23 Aug 2015 15:18:40 -0700 Subject: [PATCH 009/282] continue refactor of tests --- seed/challenges/basic-bonfires.json | 64 ++++++++++++++--------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index 6ec7aa958b..0cc2ff53c4 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -14,7 +14,7 @@ ], "tests": [ "assert(typeof(meetBonfire()) === \"boolean\", 'The result should be a Boolean value of true or false.');", - "assert(meetBonfire() === true, 'Your meetBonfire() function should return true.');" + "assert(meetBonfire() === true, 'Your meetBonfire() function should return true.');" ], "challengeSeed": [ "function meetBonfire(argument) {", @@ -87,17 +87,17 @@ "id": "a302f7aae1aa3152a5b413bc", "title": "Factorialize a Number", "tests": [ - "assert(typeof(factorialize(5)) === \"number\", 'factorialize() should return a number.');", - "assert(factorialize(5) === 120, '5 should return 120.');", - "assert(factorialize(10) === 3628800, '10 should return 3,628,800.');", - "assert(factorialize(20) === 2432902008176640000, '20 should return 2,432,902,008,176,640,000.');" + "assert(typeof(factorialize(5)) === \"number\", 'factorialize() should return a number.');", + "assert(factorialize(5) === 120, '5 should return 120.');", + "assert(factorialize(10) === 3628800, '10 should return 3,628,800.');", + "assert(factorialize(20) === 2432902008176640000, '20 should return 2,432,902,008,176,640,000.');" ], "difficulty": "1.02", "description": [ "Return the factorial of the provided integer.", "If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.", - "Factorials are often represented with the shorthand notation n!", - "For example: 5! = 1 * 2 * 3 * 4 * 5 = 120f", + "Factorials are often represented with the shorthand notation n!", + "For example: 5! = 1 * 2 * 3 * 4 * 5 = 120", "Remember to use Read-Search-Ask if you get stuck. Write your own code." ], "challengeSeed": [ @@ -135,14 +135,14 @@ "Remember to use Read-Search-Ask if you get stuck. Write your own code." ], "tests": [ - "assert(palindrome(\"eye\")) === \"boolean\", '');", - "assert.deepEqual(palindrome(\"eye\"), true, '');", - "assert.deepEqual(palindrome(\"race car\"), true, '');", - "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(\"almostomla\"), false, '');" + "assert(typeof(palindrome(\"eye\")) === \"boolean\", 'palindrome() should return a boolean.');", + "assert(palindrome(\"eye\") === true, '\"eye\" should return true.');", + "assert(palindrome(\"race car\") === true, '\"race car\" should return true.');", + "assert(palindrome(\"not a palindrome\") === false, '\"not a palindrome\" should return false.');", + "assert(palindrome(\"A man, a plan, a canal. Panama\") === true, '\"A man, a plan, a canal. Panama\" should return true.');", + "assert(palindrome(\"never odd or even\") === true, '\"never odd or even\" should return true.');", + "assert(palindrome(\"nope\") === false, '\"nope\" should return false.');", + "assert(palindrome(\"almostomla\") === false, '\"almostomla\" should return false.');" ], "challengeSeed": [ "function palindrome(str) {", @@ -152,7 +152,7 @@ "", "", "", - "palindrome(\"eye\", '');" + "palindrome(\"eye\");" ], "MDNlinks": [ "String.replace()", @@ -185,15 +185,15 @@ " return str.length;", "}", "", - "findLongestWord('The quick brown fox jumped over the lazy dog', '');" + "findLongestWord('The quick brown fox jumped over the lazy dog');" ], "tests": [ - "assert(findLongestWord('The quick brown fox jumped over the lazy dog')) === 'Number', '');", - "assert(findLongestWord('The quick brown fox jumped over the lazy dog') === 6, '');", - "assert(findLongestWord('May the force be with you') === 5, '');", - "assert(findLongestWord('Google do a barrel roll') === 6, '');", - "assert(findLongestWord('What is the average airspeed velocity of an unladen swallow') === 8, '');", - "assert(findLongestWord('What if we try a super-long word such as otorhinolaryngology') === 19, '');" + "assert(typeOf(findLongestWord(\"The quick brown fox jumped over the lazy dog\")) === 'number', 'findLongestWord() should return a number.');", + "assert(findLongestWord(\"The quick brown fox jumped over the lazy dog\") === 6, '\"The quick brown fox jumped over the lazy dog\" should return 6.');", + "assert(findLongestWord(\"May the force be with you\") === 5, '\"May the force be with you\" should return 5.');", + "assert(findLongestWord(\"Google do a barrel roll\") === 6, '\"Google do a barrel roll\" should return 6.');", + "assert(findLongestWord(\"What is the average airspeed velocity of an unladen swallow\") === 8, '\"What is the average airspeed velocity of an unladen swallow\" should return 8.');", + "assert(findLongestWord(\"What if we try a super-long word such as otorhinolaryngology\") === 19, '\"What if we try a super-long word such as otorhinolaryngology\" should return 18.');" ], "MDNlinks": [ "String.split()", @@ -229,7 +229,7 @@ "titleCase(\"I'm a little tea pot\", '');" ], "tests": [ - "assert(titleCase(\"I'm a little tea pot\")) === 'String', '');", + "assert(typeOf(titleCase(\"I'm a little tea pot\")) === 'String', 'titleCase() should return a string.');", "assert(titleCase(\"I'm a little tea pot\") === \"I'm A Little Tea Pot\", '');", "assert(titleCase(\"sHoRt AnD sToUt\") === \"Short And Stout\", '');", "assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", '');" @@ -269,7 +269,7 @@ "largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]], '');" ], "tests": [ - "assert(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])) === 'array', '');", + "assert(typeOf(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])) === 'array', 'largestOfFour() should return an array.');", "(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])).should.eql([27,5,39,1001], '');", "assert(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]).should.eql([9,35,97,1000000]), '');" ], @@ -422,10 +422,10 @@ "chunk(['a', 'b', 'c', 'd'], 2, '');" ], "tests": [ - "assert.deepEqual(chunk(['a', 'b', 'c', 'd'], 2), [['a', 'b'], ['c', 'd']], 'should return chunked arrays', '');", - "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'should return chunked arrays', '');", - "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], 'should return chunked arrays', '');", - "assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'should return the last chunk as remaining elements', '');" + "assert(chunk(['a', 'b', 'c', 'd'], 2) === [['a', 'b'], ['c', 'd']], 'chunk(['a', 'b', 'c', 'd'], 2) should return [['a', 'b'], ['c', 'd']].');", + "assert(chunk([0, 1, 2, 3, 4, 5], 3) === [[0, 1, 2], [3, 4, 5]], 'chunk([0, 1, 2, 3, 4, 5] should return [[0, 1, 2], [3, 4, 5]].');", + "assert(chunk([0, 1, 2, 3, 4, 5], 2) === [[0, 1], [2, 3], [4, 5]], 'chunk([0, 1, 2, 3, 4, 5], 2) should return [[0, 1], [2, 3], [4, 5]].');", + "assert(chunk([0, 1, 2, 3, 4, 5], 4) === [[0, 1, 2, 3], [4, 5]], 'chunk([0, 1, 2, 3, 4, 5], 4) should return [[0, 1, 2, 3], [4, 5]].');" ], "MDNlinks": [ "Array.push()" @@ -460,9 +460,9 @@ "slasher([1, 2, 3], 2, '');" ], "tests": [ - "assert.deepEqual(slasher([1, 2, 3], 2), [3], 'should drop the first two elements', '');", - "assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], 'should return all elements', '');", - "assert.deepEqual(slasher([1, 2, 3], 9), [], 'should return an empty array', '');" + "assert(slasher([1, 2, 3], 2) === [3]), 'slasher([1, 2, 3], 2), [3] should return [3].');", + "assert(slasher([1, 2, 3], 0) === [1, 2, 3]), 'slasher([1, 2, 3], 0) should return [1, 2, 3].');", + "assert(slasher([1, 2, 3], 9) === []), 'slasher([1, 2, 3], 9) should return [].');" ], "MDNlinks": [ "Array.slice()", From c264ce6e9df616f9855e803c8d24504d7e9ef095 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Sun, 23 Aug 2015 18:02:58 -0700 Subject: [PATCH 010/282] continue refactoring bonfire tests --- seed/challenges/basic-bonfires.json | 48 ++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index 0cc2ff53c4..fe3ecac9d5 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -230,9 +230,9 @@ ], "tests": [ "assert(typeOf(titleCase(\"I'm a little tea pot\")) === 'String', 'titleCase() should return a string.');", - "assert(titleCase(\"I'm a little tea pot\") === \"I'm A Little Tea Pot\", '');", - "assert(titleCase(\"sHoRt AnD sToUt\") === \"Short And Stout\", '');", - "assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", '');" + "assert(titleCase(\"I'm a little tea pot\") === \"I'm A Little Tea Pot\", '\"I'm a little tea pot\" should return \"I'm A Little Tea Pot\"');", + "assert(titleCase(\"sHoRt AnD sToUt\") === \"Short And Stout\", '\"sHoRt AnD sToUt\" should return \"Short And Stout\"');", + "assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", '\"HERE IS MY HANDLE HERE IS MY SPOUT\" should return \"Here Is My Handle Here Is My Spout\"');" ], "MDNlinks": [ "String.charAt()" @@ -270,8 +270,8 @@ ], "tests": [ "assert(typeOf(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])) === 'array', 'largestOfFour() should return an array.');", - "(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])).should.eql([27,5,39,1001], '');", - "assert(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]).should.eql([9,35,97,1000000]), '');" + "(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]) === [27,5,39,1001], '[[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]] should return [27,5,39,1001].');", + "assert(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]) === [9,35,97,1000000], '[[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]] should return [9,35,97,1000000].');" ], "MDNlinks": [ "Comparison Operators" @@ -307,11 +307,11 @@ "end('Bastian', 'n', '');" ], "tests": [ - "assert.strictEqual(end('Bastian', 'n'), true, 'should equal true if target equals end of string', '');", - "assert.strictEqual(end('Connor', 'n'), false, 'should equal false if target does not equal end of string', '');", - "assert.strictEqual(end('Walking on water and developing software from a specification are easy if both are frozen.', 'specification'), false, 'should equal false if target does not equal end of string', '');", - "assert.strictEqual(end('He has to give me a new name', 'name'), true, 'should equal true if target equals end of string', '');", - "assert.strictEqual(end('If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing', 'mountain'), false, 'should equal false if target does not equal end of string', '');" + "assert(end('Bastian', 'n') === true, 'end(\"Bastian\", \"n\") should return true.');", + "assert(end('Connor', 'n') === false, 'end(\"Connor\", \"n\") should return false.');", + "assert(end('Walking on water and developing software from a specification are easy if both are frozen.', 'specification') === false, 'end(Walking on water and developing software from a specification are easy if both are frozen.', 'specification') should return false.');", + "assert(end('He has to give me a new name', 'name') === true, 'end(\"He has to give me a new name\", \"name\") should return true.');", + "assert(end('If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing', 'mountain') === false, 'end('If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing', 'mountain') should return false.');" ], "MDNlinks": [ "String.substr()" @@ -346,9 +346,9 @@ "repeat('abc', 3, '');" ], "tests": [ - "assert.strictEqual(repeat('*', 3), '***', 'should repeat a string n times', '');", - "assert.strictEqual(repeat('abc', 3), 'abcabcabc', 'should repeat a string n times', '');", - "assert.strictEqual(repeat('abc', -2), '', 'should return an empty string for negative numbers', '');" + "assert(repeat('*', 3) === '***', 'repeat(\"*\", 3) should return \"***\");", + "assert(repeat('abc', 3) === 'abcabcabc', 'repeat(\"abc\", 3) should return \"abcabcabc\".');", + "assert(repeat('abc', -2) === '', 'repeat(\"abc\", -2) should return \"\".');" ], "MDNlinks": [ "Global String Object" @@ -384,10 +384,10 @@ "truncate('A-tisket a-tasket A green and yellow basket', 11, '');" ], "tests": [ - "assert(truncate('A-tisket a-tasket A green and yellow basket', 11)).to.eqls('A-tisket...', '');", - "assert(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', '');" + "assert(truncate('A-tisket a-tasket A green and yellow basket', 11) === 'A-tisket...', 'truncate(\"A-tisket a-tasket A green and yellow basket\", 11) should return \"A-tisket...\".');", + "assert(truncate('Peter Piper picked a peck of pickled peppers', 14) === 'Peter Piper...', 'truncate(\"Peter Piper picked a peck of pickled peppers\", 14) should return \"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', 'truncate(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length) should return \"A-tisket a-tasket A green and yellow basket\".');", + "assert(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', 'truncate(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length + 2) should return \"A-tisket a-tasket A green and yellow basket\".);" ], "MDNlinks": [ "String.slice()" @@ -422,10 +422,10 @@ "chunk(['a', 'b', 'c', 'd'], 2, '');" ], "tests": [ - "assert(chunk(['a', 'b', 'c', 'd'], 2) === [['a', 'b'], ['c', 'd']], 'chunk(['a', 'b', 'c', 'd'], 2) should return [['a', 'b'], ['c', 'd']].');", - "assert(chunk([0, 1, 2, 3, 4, 5], 3) === [[0, 1, 2], [3, 4, 5]], 'chunk([0, 1, 2, 3, 4, 5] should return [[0, 1, 2], [3, 4, 5]].');", - "assert(chunk([0, 1, 2, 3, 4, 5], 2) === [[0, 1], [2, 3], [4, 5]], 'chunk([0, 1, 2, 3, 4, 5], 2) should return [[0, 1], [2, 3], [4, 5]].');", - "assert(chunk([0, 1, 2, 3, 4, 5], 4) === [[0, 1, 2, 3], [4, 5]], 'chunk([0, 1, 2, 3, 4, 5], 4) should return [[0, 1, 2, 3], [4, 5]].');" + "assert(chunk(['a', 'b', 'c', 'd'], 2) === [['a', 'b'], ['c', 'd']], 'chunk([\"a\", \"b\", \"c\", \"d\"], 2) should return [[\"a\", \"b\"], [\"c\", \"d\"]].');", + "assert(chunk([0, 1, 2, 3, 4, 5], 3) === [[0, 1, 2], [3, 4, 5]], 'chunk([0, 1, 2, 3, 4, 5] should return [[0, 1, 2], [3, 4, 5]].');", + "assert(chunk([0, 1, 2, 3, 4, 5], 2) === [[0, 1], [2, 3], [4, 5]], 'chunk([0, 1, 2, 3, 4, 5], 2) should return [[0, 1], [2, 3], [4, 5]].');", + "assert(chunk([0, 1, 2, 3, 4, 5], 4) === [[0, 1, 2, 3], [4, 5]], 'chunk([0, 1, 2, 3, 4, 5], 4) should return [[0, 1, 2, 3], [4, 5]].');" ], "MDNlinks": [ "Array.push()" @@ -460,9 +460,9 @@ "slasher([1, 2, 3], 2, '');" ], "tests": [ - "assert(slasher([1, 2, 3], 2) === [3]), 'slasher([1, 2, 3], 2), [3] should return [3].');", - "assert(slasher([1, 2, 3], 0) === [1, 2, 3]), 'slasher([1, 2, 3], 0) should return [1, 2, 3].');", - "assert(slasher([1, 2, 3], 9) === []), 'slasher([1, 2, 3], 9) should return [].');" + "assert(slasher([1, 2, 3], 2) === [3]), 'slasher([1, 2, 3], 2), [3] should return [3].');", + "assert(slasher([1, 2, 3], 0) === [1, 2, 3]), 'slasher([1, 2, 3], 0) should return [1, 2, 3].');", + "assert(slasher([1, 2, 3], 9) === []), 'slasher([1, 2, 3], 9) should return [].');" ], "MDNlinks": [ "Array.slice()", From fbbbff2186299817b965e362dbc0a241f02692f7 Mon Sep 17 00:00:00 2001 From: Aryan Jabbari Date: Mon, 24 Aug 2015 23:11:21 -0400 Subject: [PATCH 011/282] Changed 'Show the Local Weather' wording to fix #2623 --- seed/challenges/basic-ziplines.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/challenges/basic-ziplines.json b/seed/challenges/basic-ziplines.json index 37e547c4e3..c1a6ec00f9 100644 --- a/seed/challenges/basic-ziplines.json +++ b/seed/challenges/basic-ziplines.json @@ -115,8 +115,8 @@ "Rule #3: Reverse engineer the example project's functionality, and also feel free to personalize it.", "Here are the user stories you must enable, and optional bonus user stories:", "User Story: As a user, I can see the weather in my current location.", - "Bonus User Story: As a user, I can see an icon depending on the temperature..", - "Bonus User Story: As a user, I see a different background image depending on the temperature (e.g. snowy mountain, hot desert).", + "Bonus User Story: As a user, I can see an icon depending on the weather.", + "Bonus User Story: As a user, I see a different background image (e.g. snowy mountain, hot desert) depending on the weather.", "Bonus User Story: As a user, I can push a button to toggle between Fahrenheit and Celsius.", "Remember to use Read-Search-Ask if you get stuck.", "When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. If you pair programmed, you should also include the Free Code Camp username of your pair.", From 547fa9424f5faeed2647d64d452a564de20b1a6e Mon Sep 17 00:00:00 2001 From: sJhonny-e Date: Tue, 25 Aug 2015 18:12:17 +0300 Subject: [PATCH 012/282] changed regex for checking style element in challenge "Use CSS Selectors to Style Elements"; regex now allows opening style elements to have whitespace before closing '>', and also the allowed attributes (type, media etc..) --- seed/challenges/html5-and-css.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/html5-and-css.json b/seed/challenges/html5-and-css.json index b93a1de494..b81dbd4356 100644 --- a/seed/challenges/html5-and-css.json +++ b/seed/challenges/html5-and-css.json @@ -383,7 +383,7 @@ "assert(!$(\"h2\").attr(\"style\"), 'Remove the style attribute from your h2 element.')", "assert($(\"style\") && $(\"style\").length > 1, 'Create a style element.')", "assert($(\"h2\").css(\"color\") === \"rgb(0, 0, 255)\", 'Your h2 element should be blue.')", - "assert(editor.match(/<\\/style>/g) && editor.match(/<\\/style>/g).length === editor.match(/", "", "
", - "

CatPhotoApp

", + "

CatPhotoApp

", "", - "

Click here for cat photos.

", - "", - " ", + " ", "", " ", "
", From ccb88cadf35f7b9b174c05b9fe2dd4928752c758 Mon Sep 17 00:00:00 2001 From: Dmytro Yarmak Date: Tue, 8 Sep 2015 10:58:50 +0300 Subject: [PATCH 073/282] Add output block to "Iterate with JavaScript While Loops" challange --- seed/challenges/basic-javascript.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index 11c6b67e72..f273197e75 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -859,8 +859,14 @@ ], "challengeSeed":[ "var myArray = [];", - "//Push the numbers zero through four to myArray", + "// Only change code below this line.", "", + "// Push the numbers zero through four to myArray using a \"while loop\".", + "", + "// Only change code above this line.", + "// We use this function to show you the value of your variable in your output box.", + "// You'll learn about functions soon.", + "if(typeof(myArray) !== \"undefined\"){(function(){return myArray;})();}", "" ], "type": "waypoint", From 721ea81593e840607bbd8f02f14d18b3777687e9 Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Tue, 8 Sep 2015 16:06:44 +0530 Subject: [PATCH 074/282] Add more falsy values --- seed/challenges/basic-bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index 66ecefde0b..250e4a9a2a 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -549,7 +549,7 @@ "tests": [ "assert.deepEqual(bouncer([7, 'ate', '', false, 9]), [7, 'ate', 9], 'should remove falsy values');", "assert.deepEqual(bouncer(['a', 'b', 'c']), ['a', 'b', 'c'], 'should return full array if no falsy elements');", - "assert.deepEqual(bouncer([false, null, 0]), [], 'should return empty array if all elements are falsy');" + "assert.deepEqual(bouncer([false, null, 0, NaN, undefined, '']), [], 'should return empty array if all elements are falsy');" ], "MDNlinks": [ "Boolean Objects", From 8fd99e3350a8671a611fafdc74197f629f373086 Mon Sep 17 00:00:00 2001 From: bugron Date: Sun, 6 Sep 2015 14:41:55 +0400 Subject: [PATCH 075/282] removes unnecessary class --- server/views/coursewares/showHTML.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/views/coursewares/showHTML.jade b/server/views/coursewares/showHTML.jade index b5e4a72908..64a10cc314 100644 --- a/server/views/coursewares/showHTML.jade +++ b/server/views/coursewares/showHTML.jade @@ -49,7 +49,7 @@ block content var userLoggedIn = true; else .button-spacer - a.btn.signup-btn.btn-block.btn-block.negative-15(href='/login') Sign in so you can save your progress + a.btn.signup-btn.btn-block.btn-block(href='/login') Sign in so you can save your progress script. var userLoggedIn = false; .button-spacer From e0db3181d399007c010e8da85bef1147c0bae66f Mon Sep 17 00:00:00 2001 From: bugron Date: Tue, 8 Sep 2015 17:21:12 +0400 Subject: [PATCH 076/282] fixes an idle test and some text --- seed/challenges/basic-javascript.json | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index da1c55830e..f4c0377b50 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -974,13 +974,14 @@ "Create an if-else statement to return heads if the flip var is zero, or else return tails if it's not." ], "tests":[ - "assert((function(){if(myFunction() === \"heads\" || myFunction() === \"tails\"){return true;}else{return false;}})(), 'myFunction should either return heads or tails');", - "assert(editor.getValue().match(/if/g).length >= 3, 'You should have created a new if statement');", - "assert(editor.getValue().match(/else/g).length >= 2, 'You should have created a new else statement');" + "assert((function(){var result = myFunction();if(result === 'heads' || result === 'tails'){return true;} else {return false;}})(), 'myFunction should either return heads or tails.');", + "assert((function(){var result = myFunction();if(result === 'heads' && flip === 0 || result === 'tails' && flip !== 0){return true;} else {return false;}})(), 'myFunction should return heads when flip equals 0 and tails when flip equals 1.');", + "assert(editor.getValue().match(/if/g).length >= 4, 'You should have created a new if statement.');", + "assert(editor.getValue().match(/else/g).length >= 2, 'You should have created a new else statement.');" ], "challengeSeed":[ + "var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;", "function myFunction(){", - " var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;", " // Create an if-else statement here to return \"heads\" if flip is 0. Otherwise return \"tails\".", "", " // Only change code below this line.", @@ -990,7 +991,7 @@ "", "// Only change code above this line.", "// We use this function to show you the value of your variable in your output box.", - "(function(){return myFunction();})();" + "var result = myFunction();if(typeof(flip) !== \"undefined\" && typeof(flip) === \"number\" && typeof(result) !== \"undefined\" && typeof(result) === \"string\"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}" ], "type": "waypoint", "challengeType": 1 From 36acb95a0bd0c3de707ce53511529354a89d2292 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Tue, 8 Sep 2015 09:18:01 -0700 Subject: [PATCH 077/282] Update contributing to best practices removes mention of contributors group. mention git rebase article change to free code camps style guide over AirBnB's. --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e9ab6393c6..7590eccafe 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,9 @@ We welcome pull requests from Free Code Camp campers (our students) and seasoned 2. Pick an issue that nobody has claimed and start working on it. If your issue isn't on the board, open an issue. If you think you can fix it yourself, start working on it. Feel free to ask for help in our [Gitter](https://gitter.im/FreeCodeCamp/FreeCodeCamp). 3. Fork the project ([Need help with forking a project?](https://help.github.com/articles/fork-a-repo/)). You'll do all of your work on your forked copy. 4. Create a branch specific to the issue or feature you are working on. Push your work to that branch. ([Need help with branching?](https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches)) -5. Name the branch something like `user-xxx` where `user` is your username and `xxx` is the issue number you are addressing. -6. You should have [ESLint running in your editor](http://eslint.org/docs/user-guide/integrations.html), and it will highlight anything doesn't conform to [AirBnB's JavaScript Style Guide](https://github.com/airbnb/javascript). Please do not ignore any linting errors, as they are meant to **help** you. Make sure none of your JavaScript is longer than 80 characters per line. -7. Once your code is ready, submit a pull request from your branch to Free Code Camp's `staging` branch. We'll do a quick code review and give you feedback, then iterate from there. -8. Once we accept one of your pull requests, one of the project owners (currently @quincylarson, @terakilobyte, and @berkeleytrue) will add you to our camper contributor group. +5. Name the branch something like `fix/xxx` or `feature/xxx` where `xxx` is a short description of the changes or feature you are attempting to add. For example `fix/email-login` whould be a branch where I fix something specific to email login. +6. You should have [ESLint running in your editor](http://eslint.org/docs/user-guide/integrations.html), and it will highlight anything doesn't conform to [Free Code Camp's JavaScript Style Guide](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Free-Code-Camp-JavaScript-Style-Guide) (you can find a summory of those rules [here](https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/.eslintrc). Please do not ignore any linting errors, as they are meant to **help** you and to ensure a clean and simple code base. Make sure none of your JavaScript is longer than 80 characters per line. +7. Once your code is ready, submit a pull request from your branch to Free Code Camp's `staging` branch. We'll do a quick code review and give you feedback, then iterate from there. It may also be helpful to read about git [rebasing](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/git-rebase). Prerequisites ------------- From e7382667268b79895c8b49c5f858d75337bd366e Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Tue, 8 Sep 2015 09:19:28 -0700 Subject: [PATCH 078/282] Add contributing guidelines from README --- CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ba4e245107..9511ab33cc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,2 +1,12 @@ We're getting a lot of duplicate issues and bug reports that just aren't reporting actual bugs. So, before you submit your issue, please read the [Help I've Found a Bug](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Help-I've-Found-a-Bug) wiki page. + +We welcome pull requests from Free Code Camp campers (our students) and seasoned JavaScript developers alike! Follow these steps to contribute: + +1. Check our [public Waffle Board](https://waffle.io/freecodecamp/freecodecamp). +2. Pick an issue that nobody has claimed and start working on it. If your issue isn't on the board, open an issue. If you think you can fix it yourself, start working on it. Feel free to ask for help in our [Gitter](https://gitter.im/FreeCodeCamp/FreeCodeCamp). +3. Fork the project ([Need help with forking a project?](https://help.github.com/articles/fork-a-repo/)). You'll do all of your work on your forked copy. +4. Create a branch specific to the issue or feature you are working on. Push your work to that branch. ([Need help with branching?](https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches)) +5. Name the branch something like `fix/xxx` or `feature/xxx` where `xxx` is a short description of the changes or feature you are attempting to add. For example `fix/email-login` whould be a branch where I fix something specific to email login. +6. You should have [ESLint running in your editor](http://eslint.org/docs/user-guide/integrations.html), and it will highlight anything doesn't conform to [Free Code Camp's JavaScript Style Guide](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Free-Code-Camp-JavaScript-Style-Guide) (you can find a summory of those rules [here](https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/.eslintrc). Please do not ignore any linting errors, as they are meant to **help** you and to ensure a clean and simple code base. Make sure none of your JavaScript is longer than 80 characters per line. +7. Once your code is ready, submit a pull request from your branch to Free Code Camp's `staging` branch. We'll do a quick code review and give you feedback, then iterate from there. It may also be helpful to read about git [rebasing](https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/git-rebase). From d884aaa924e2f38808fcf332525525e8596a2cc8 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Tue, 8 Sep 2015 13:45:18 -0700 Subject: [PATCH 079/282] remove contributors list from package.json We now have over a hundred contributors and this should not be listed in the package.json --- package.json | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/package.json b/package.json index d35a1c4cf9..44833cc65d 100644 --- a/package.json +++ b/package.json @@ -14,16 +14,6 @@ "test": "mocha --compilers js:babel/register" }, "license": "(BSD-3-Clause AND CC-BY-SA-4.0)", - "contributors": [ - { - "name": "Quincy Larson", - "url": "https://github.com/QuincyLarson" - }, - { - "name": "Nathan Leniz", - "url": "https://github.com/terakilobyte" - } - ], "dependencies": { "accepts": "~1.2.5", "async": "~0.9.0", From b54b2de9abe67f68bef52fac53181fc7217fbc42 Mon Sep 17 00:00:00 2001 From: Aryan Jabbari Date: Sat, 5 Sep 2015 20:10:14 -0400 Subject: [PATCH 080/282] Clarifies instructions for shift() challenge; closes #1875 --- seed/challenges/basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index 7c5df36b40..46fd8b5ac3 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -604,7 +604,7 @@ "difficulty": "9.9817", "description": [ "pop() always removes the last element of an array. What if you want to remove the first? That's where .shift() comes in.", - "Take the myArray array and shift() the first value off of it." + "Take the myArray array and shift() the first value off of it. Set myRemoved to the first value of myArray using shift()." ], "tests": [ "assert((function(d){if(d[0] == 23 && d[1][0] == 'dog' && d[1][1] == 3 && d[2] == undefined){return true;}else{return false;}})(myArray), 'myArray should only have the last two values left([23, [\"dog\", 3]])');", From c57251a446eb09842783fb7f77fba38f43dd62af Mon Sep 17 00:00:00 2001 From: suhussai Date: Sun, 23 Aug 2015 12:52:59 -0600 Subject: [PATCH 081/282] Added link about Roman Numeral to MDNLinks section Added link mentioned in Waypoint description about Roman Numerals to MDNLinks in order to make it more apparent. Affects Waypoint 3 in Intermediate Algorithm Scripting. http://www.freecodecamp.com/challenges/bonfire-roman-numeral-converter closes #2557. --- seed/bonfireMDNlinks.js | 5 +++-- seed/challenges/intermediate-bonfires.json | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/seed/bonfireMDNlinks.js b/seed/bonfireMDNlinks.js index 0e0b0f89b1..4a5c6ea6b2 100644 --- a/seed/bonfireMDNlinks.js +++ b/seed/bonfireMDNlinks.js @@ -14,8 +14,9 @@ var links = "Permutations": "https://www.mathsisfun.com/combinatorics/combinations-permutations.html", "HTML Entities": "http://dev.w3.org/html5/html-author/charref", "Symmetric Difference": "https://www.youtube.com/watch?v=PxffSUQRkG4", - - // ========= GLOBAL OBJECTS + "Roman Numerals": "http://www.mathsisfun.com/roman-numerals.html", + + // ========= GLOBAL OBJECTS "Global Array Object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", "Global Object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", "Global String Object" : "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", diff --git a/seed/challenges/intermediate-bonfires.json b/seed/challenges/intermediate-bonfires.json index 80adf23020..c1ee08807d 100644 --- a/seed/challenges/intermediate-bonfires.json +++ b/seed/challenges/intermediate-bonfires.json @@ -113,6 +113,7 @@ "convert(36);" ], "MDNlinks": [ + "Roman Numerals", "Array.splice()", "Array.indexOf()", "Array.join()" From 1c618799b41ee8062da050d4636c29f11e6063f7 Mon Sep 17 00:00:00 2001 From: Aniruddh Agarwal Date: Wed, 9 Sep 2015 10:02:08 +0800 Subject: [PATCH 082/282] Fixed typo in Basic Javascript Waypoint Waypoint 'Sift through Text with Regular Expressions' had `...` in its description instead of `.`. Made the required changes. closes #3169 --- seed/challenges/basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index 6b77ebac56..69b3a65487 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -1022,7 +1022,7 @@ "g means that we want to search the entire string for this pattern instead of just the first match.", "i means that we want to ignore the case (uppercase or lowercase) when searching for the pattern.", "Regular expressions are written by surrounding the pattern with a / symbol.", - "Let's try selecting all the occurrences of the word and in the string George Boole and Alan Turing went to the shop and got some milk. We can do this by replacing the ... part of our regular expression with the current regular expression with the word and." + "Let's try selecting all the occurrences of the word and in the string George Boole and Alan Turing went to the shop and got some milk. We can do this by replacing the . part of our regular expression with the current regular expression with the word and." ], "tests":[ "assert(test==2, 'Your regular expression should find two occurrences of the word and');", From 9067154566cdef98253d42b368bd9232105bd47e Mon Sep 17 00:00:00 2001 From: Aniruddh Agarwal Date: Wed, 9 Sep 2015 11:52:21 +0800 Subject: [PATCH 083/282] Fix typo in basic-javascript waypoint Waypoint 'Invert Regular Expression Matches with JavaScript' had a semi-colon in the description for the regex example which is not needed. closes #3148 --- seed/challenges/basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index b7c5ea2dc2..b42dcf7db4 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -1109,7 +1109,7 @@ "title": "Invert Regular Expression Matches with JavaScript", "difficulty":"9.987", "description":[ - "Use /\\S/gi; to match everything that isn't a space in the string.", + "Use /\\S/gi to match everything that isn't a space in the string.", "You can invert any match by using the uppercase version of the selector \\s versus \\S for example." ], "tests":[ From 471236b8141d5b9658c6f1c8ae21d548e2f7593e Mon Sep 17 00:00:00 2001 From: Aniruddh Agarwal Date: Wed, 9 Sep 2015 11:44:53 +0800 Subject: [PATCH 084/282] Fixed wording error in HTML/CSS waypoint Waypoint 'Add Different Padding to Each Side of an Element' had a small wording error: the tests were missing `the` closes #3130 --- seed/challenges/html5-and-css.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/seed/challenges/html5-and-css.json b/seed/challenges/html5-and-css.json index 29bb0cae22..f67197acf5 100644 --- a/seed/challenges/html5-and-css.json +++ b/seed/challenges/html5-and-css.json @@ -2842,10 +2842,10 @@ "Give the green box a padding of 40px on its top and left side, but only 20px on its bottom and right side." ], "tests": [ - "assert($(\".green-box\").css(\"padding-top\") === \"40px\", 'Your green-box class should give the top of elements 40px of padding.')", - "assert($(\".green-box\").css(\"padding-left\") === \"40px\", 'Your green-box class should give the left of elements 40px of padding.')", - "assert($(\".green-box\").css(\"padding-right\") === \"20px\", 'Your green-box class should give the right of elements 20px of padding.')", - "assert($(\".green-box\").css(\"padding-bottom\") === \"20px\", 'Your green-box class should give the bottom of elements 20px of padding.')" + "assert($(\".green-box\").css(\"padding-top\") === \"40px\", 'Your green-box class should give the top of the elements 40px of padding.')", + "assert($(\".green-box\").css(\"padding-left\") === \"40px\", 'Your green-box class should give the left of the elements 40px of padding.')", + "assert($(\".green-box\").css(\"padding-right\") === \"20px\", 'Your green-box class should give the right of the elements 20px of padding.')", + "assert($(\".green-box\").css(\"padding-bottom\") === \"20px\", 'Your green-box class should give the bottom of the elements 20px of padding.')" ], "challengeSeed": [ "