merge staging

This commit is contained in:
Quincy Larson
2015-09-29 13:44:58 -07:00
parent 144ae3bef2
commit 5dbdbbdc4d

View File

@ -19,11 +19,11 @@
"sumAll([1, 4]);" "sumAll([1, 4]);"
], ],
"tests": [ "tests": [
"expect(sumAll([1, 4])).to.be.a('Number');", "assert(typeof(sumAll([1, 4])) === \"number\", 'message: <code>sumAll()</code> should return a number');",
"expect(sumAll([1, 4])).to.equal(10);", "assert.deepEqual(sumAll([1, 4]), 10, 'message: <code>sumAll([1, 4])</code> should return 10');",
"expect(sumAll([4, 1])).to.equal(10);", "assert.deepEqual(sumAll([4, 1]), 10, 'message: <code>sumAll([4, 1])</code> should return 10');",
"expect(sumAll([5, 10])).to.equal(45);", "assert.deepEqual(sumAll([5, 10]), 45, 'message: <code>sumAll([5, 10])</code> should return 45');",
"expect(sumAll([10, 5])).to.equal(45);" "assert.deepEqual(sumAll([10, 5]), 45, 'message: <code>sumAll([10, 5])</code> should return 45');"
], ],
"MDNlinks": [ "MDNlinks": [
"Math.max()", "Math.max()",
@ -61,13 +61,13 @@
"diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);" "diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);"
], ],
"tests": [ "tests": [
"expect(diff([1, 2, 3, 5], [1, 2, 3, 4, 5])).to.be.a('array');", "assert(typeof(diff([1, 2, 3, 5], [1, 2, 3, 4, 5])) === \"object\", 'message: <code>diff()</code> should return an array.');",
"assert.deepEqual(diff(['diorite', 'andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']), ['pink wool'], 'arrays with only one difference');", "assert.deepEqual(diff(['diorite', 'andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']), ['pink wool'], 'message: <code>['diorite', 'andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']</code> should return <code>['pink wool']</code>.');",
"assert.includeMembers(diff(['andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']), ['diorite', 'pink wool'], 'arrays with more than one difference');", "assert.includeMembers(diff(['andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']), ['diorite', 'pink wool'], 'message: <code>['andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']</code> should return <code>['diorite', 'pink wool']</code>.');",
"assert.deepEqual(diff(['andesite', 'grass', 'dirt', 'dead shrub'], ['andesite', 'grass', 'dirt', 'dead shrub']), [], 'arrays with no difference');", "assert.deepEqual(diff(['andesite', 'grass', 'dirt', 'dead shrub'], ['andesite', 'grass', 'dirt', 'dead shrub']), [], 'message: <code>['andesite', 'grass', 'dirt', 'dead shrub'], ['andesite', 'grass', 'dirt', 'dead shrub']</code> should return <code>[]</code>.');",
"assert.deepEqual(diff([1, 2, 3, 5], [1, 2, 3, 4, 5]), [4], 'arrays with numbers');", "assert.deepEqual(diff([1, 2, 3, 5], [1, 2, 3, 4, 5]), [4], 'message: <code>[1, 2, 3, 5], [1, 2, 3, 4, 5]</code> should return <code>[4]</code>.');",
"assert.includeMembers(diff([1, 'calf', 3, 'piglet'], [1, 'calf', 3, 4]), ['piglet', 4], 'arrays with numbers and strings');", "assert.includeMembers(diff([1, 'calf', 3, 'piglet'], [1, 'calf', 3, 4]), ['piglet', 4], 'message: <code>[1, 'calf', 3, 'piglet'], [1, 'calf', 3, 4]</code> should return <code>['piglet', 4]</code>.');",
"assert.deepEqual(diff([], ['snuffleupagus', 'cookie monster', 'elmo']), ['snuffleupagus', 'cookie monster', 'elmo'], 'empty array');" "assert.deepEqual(diff([], ['snuffleupagus', 'cookie monster', 'elmo']), ['snuffleupagus', 'cookie monster', 'elmo'], 'message: <code>[], ['snuffleupagus', 'cookie monster', 'elmo']</code> should return <code>['snuffleupagus', 'cookie monster', 'elmo']</code>.');"
], ],
"MDNlinks": [ "MDNlinks": [
"Comparison Operators", "Comparison Operators",
@ -93,11 +93,11 @@
"id": "a7f4d8f2483413a6ce226cac", "id": "a7f4d8f2483413a6ce226cac",
"title": "Roman Numeral Converter", "title": "Roman Numeral Converter",
"tests": [ "tests": [
"expect(convert(12)).to.equal(\"XII\");", "assert.deepEqual(convert(12), \"XII\", 'message: <code>convert(12)</code> should return \"XII\"');",
"expect(convert(5)).to.equal(\"V\");", "assert.deepEqual(convert(5), \"V\", 'message: <code>convert(5)</code> should return \"V\"');",
"expect(convert(9)).to.equal(\"IX\");", "assert.deepEqual(convert(9), \"IX\", 'message: <code>convert(9)</code> should return \"IX\"');",
"expect(convert(29)).to.equal(\"XXIX\");", "assert.deepEqual(convert(29), \"XXIX\", 'message: <code>convert(29)</code> should return \"XXIX\"');",
"expect(convert(16)).to.equal(\"XVI\");" "assert.deepEqual(convert(16), \"XVI\", 'message: <code>convert(16)</code> should return \"XVI\"');"
], ],
"difficulty": "2.02", "difficulty": "2.02",
"description": [ "description": [
@ -150,10 +150,10 @@
"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": [ "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([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }), [{ first: 'Tybalt', last: 'Capulet' }], 'message: <code>where()</code> 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([{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], { 'a': 1 }), [{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], 'message: <code></code> should return <code></code>.');",
"assert.deepEqual(where([{ 'a': 1, 'b': 2 }, { 'a': 1 }, { 'a': 1, 'b': 2, 'c': 2 }], { 'a': 1, 'b': 2 }), [{ 'a': 1, 'b': 2 }, { 'a': 1, 'b': 2, 'c': 2 }], 'should return two objects in array');", "assert.deepEqual(where([{ 'a': 1, 'b': 2 }, { 'a': 1 }, { 'a': 1, 'b': 2, 'c': 2 }], { 'a': 1, 'b': 2 }), [{ 'a': 1, 'b': 2 }, { 'a': 1, 'b': 2, 'c': 2 }], 'message: <code></code> should return <code></code>.');",
"assert.deepEqual(where([{ 'a': 5 }, { 'a': 5 }, { 'a': 5, 'b': 10 }], { 'a': 5, 'b': 10 }), [{ 'a': 5, 'b': 10 }], 'should return a single object in array');" "assert.deepEqual(where([{ 'a': 5 }, { 'b': 10 }, { 'a': 5, 'b': 10 }], { 'a': 5, 'b': 10 }), [{ 'a': 5, 'b': 10 }], 'message: <code></code> should return <code></code>.');"
], ],
"MDNlinks": [ "MDNlinks": [
"Global Object", "Global Object",
@ -177,11 +177,11 @@
"id": "a0b5010f579e69b815e7c5d6", "id": "a0b5010f579e69b815e7c5d6",
"title": "Search and Replace", "title": "Search and Replace",
"tests": [ "tests": [
"expect(myReplace(\"Let us go to the store\", \"store\", \"mall\")).to.equal(\"Let us go to the mall\");", "assert.deepEqual(replace(\"Let us go to the store\", \"store\", \"mall\"), \"Let us go to the mall\", 'message: <code>replace(\"Let us go to the store\", \"store\", \"mall\")</code> should return \"Let us go to the mall\"');",
"expect(myReplace(\"He is Sleeping on the couch\", \"Sleeping\", \"sitting\")).to.equal(\"He is Sitting on the couch\");", "assert.deepEqual(replace(\"He is Sleeping on the couch\", \"Sleeping\", \"sitting\"), \"He is Sitting on the couch\", 'message: <code>replace(\"He is Sleeping on the couch\", \"Sleeping\", \"sitting\")</code> should return \"He is Sitting on the couch\"');",
"expect(myReplace(\"This has a spellngi error\", \"spellngi\", \"spelling\")).to.equal(\"This has a spelling error\");", "assert.deepEqual(replace(\"This has a spellngi error\", \"spellngi\", \"spelling\"), \"This has a spelling error\", 'message: <code>replace(\"This has a spellngi error\", \"spellingi\", \"spelling\")</code> should return \"This has a spelling error\"');",
"expect(myReplace(\"His name is Tom\", \"Tom\", \"john\")).to.equal(\"His name is John\");", "assert.deepEqual(replace(\"His name is Tom\", \"Tom\", \"john\"), \"His name is John\", 'message: <code>replace(\"His name is Tom\", \"Tom\", \"john\")</code> should return \"His name is John\"');",
"expect(myReplace(\"Let us get back to more Coding\", \"Coding\", \"bonfires\")).to.equal(\"Let us get back to more Bonfires\");" "assert.deepEqual(replace(\"Let us get back to more Coding\", \"Coding\", \"bonfires\"), \"Let us get back to more Bonfires\", 'message: <code>replace(\"Let us get back to more Coding\", \"Coding\", \"bonfires\")</code> should return \"Let us get back to more Bonfires\"');"
], ],
"difficulty": "2.035", "difficulty": "2.035",
"description": [ "description": [
@ -221,11 +221,11 @@
"id": "aa7697ea2477d1316795783b", "id": "aa7697ea2477d1316795783b",
"title": "Pig Latin", "title": "Pig Latin",
"tests": [ "tests": [
"expect(translate(\"california\")).to.equal(\"aliforniacay\");", "assert.deepEqual(translate(\"california\"), \"aliforniacay\", 'message: <code>translate(\"california\")</code> should return \"aliforniacay\"');",
"expect(translate(\"paragraphs\")).to.equal(\"aragraphspay\");", "assert.deepEqual(translate(\"paragraphs\"), \"aragraphspay\", 'message: <code>translate(\"paragraphs\")</code> should return \"aragraphspay\"');",
"expect(translate(\"glove\")).to.equal(\"oveglay\");", "assert.deepEqual(translate(\"glove\"), \"oveglay\", 'message: <code>translate(\"glove\")</code> should return \"oveglay\"');",
"expect(translate(\"algorithm\")).to.equal(\"algorithmway\");", "assert.deepEqual(translate(\"algorithm\"), \"algorithmway\", 'message: <code>translate(\"algorithm\")</code> should return \"algorithmway\"');",
"expect(translate(\"eight\")).to.equal(\"eightway\");" "assert.deepEqual(translate(\"eight\"), \"eightway\", 'message: <code>translate(\"eight\")</code> should return \"eightway\"');"
], ],
"difficulty": "2.04", "difficulty": "2.04",
"description": [ "description": [
@ -265,9 +265,9 @@
"id": "afd15382cdfb22c9efe8b7de", "id": "afd15382cdfb22c9efe8b7de",
"title": "DNA Pairing", "title": "DNA Pairing",
"tests": [ "tests": [
"assert.deepEqual(pair(\"ATCGA\"),[['A','T'],['T','A'],['C','G'],['G','C'],['A','T']], 'should return the dna pair');", "assert.deepEqual(pair(\"ATCGA\"),[['A','T'],['T','A'],['C','G'],['G','C'],['A','T']], 'message: <code></code> should return <code></code>.');",
"assert.deepEqual(pair(\"TTGAG\"),[['T','A'],['T','A'],['G','C'],['A','T'],['G','C']], 'should return the dna pair');", "assert.deepEqual(pair(\"TTGAG\"),[['T','A'],['T','A'],['G','C'],['A','T'],['G','C']], 'message: <code></code> should return <code></code>.');",
"assert.deepEqual(pair(\"CTCTA\"),[['C','G'],['T','A'],['C','G'],['T','A'],['A','T']], 'should return the dna pair');" "assert.deepEqual(pair(\"CTCTA\"),[['C','G'],['T','A'],['C','G'],['T','A'],['A','T']], 'message: <code></code> should return <code></code>.');"
], ],
"difficulty": "2.05", "difficulty": "2.05",
"description": [ "description": [
@ -319,10 +319,10 @@
"fearNotLetter('abce');" "fearNotLetter('abce');"
], ],
"tests": [ "tests": [
"expect(fearNotLetter('abce')).to.equal('d');", "assert.deepEqual(fearNotLetter(\"abce\"), \"d\", 'message: <code>fearNotLetter(\"abce\")</code> should return d');",
"expect(fearNotLetter('bcd')).to.be.undefined;", "assert.deepEqual(fearNotLetter(\"abcdefghjklmno\"), \"i\", 'message: <code>fearNotLetter(\"abcdefghjklmno\")</code> should return i');",
"expect(fearNotLetter('abcdefghjklmno')).to.equal('i');", "assert.isUndefined(fearNotLetter(\"bcd\"), 'message: <code>fearNotLetter(\"bcd\")</code> should return undefined');",
"expect(fearNotLetter('yz')).to.be.undefined;" "assert.isUndefined(fearNotLetter(\"yz\"), 'message: <code>fearNotLetter(\"yz\")</code> should return undefined');"
], ],
"MDNlinks": [ "MDNlinks": [
"String.charCodeAt()", "String.charCodeAt()",
@ -359,14 +359,14 @@
"boo(null);" "boo(null);"
], ],
"tests": [ "tests": [
"assert.strictEqual(boo(true), true);", "assert.strictEqual(boo(true), true, 'message: <code></code> should return true.');",
"assert.strictEqual(boo(false), true);", "assert.strictEqual(boo(false), true, 'message: <code></code> should return true.');",
"assert.strictEqual(boo([1, 2, 3]), false);", "assert.strictEqual(boo([1, 2, 3]), false, 'message: <code></code> should return false.');",
"assert.strictEqual(boo([].slice), false);", "assert.strictEqual(boo([].slice), false, 'message: <code></code> should return false.');",
"assert.strictEqual(boo({ 'a': 1 }), false);", "assert.strictEqual(boo({ 'a': 1 }), false, 'message: <code></code> should return false.');",
"assert.strictEqual(boo(1), false);", "assert.strictEqual(boo(1), false, 'message: <code></code> should return false.');",
"assert.strictEqual(boo(NaN), false);", "assert.strictEqual(boo(NaN), false, 'message: <code></code> should return true.');",
"assert.strictEqual(boo('a'), false);" "assert.strictEqual(boo('a'), false, 'message: <code></code> should return false.');"
], ],
"MDNlinks": [ "MDNlinks": [
"Boolean Objects" "Boolean Objects"
@ -525,12 +525,12 @@
"sumFibs(4);" "sumFibs(4);"
], ],
"tests": [ "tests": [
"expect(sumFibs(1)).to.be.a('number');", "assert.deepEqual(typeof(sumFibs(1)), \"number\", \"The result should be a number\");",
"expect(sumFibs(1000)).to.equal(1785);", "assert.deepEqual(sumFibs(1000), 1785, 'message: <code>sumFibs(1000)</code> should return 1785');",
"expect(sumFibs(4000000)).to.equal(4613732);", "assert.deepEqual(sumFibs(4000000), 4613732, 'message: <code>sumFibs(4000000)</code> should return 4613732');",
"expect(sumFibs(4)).to.equal(5);", "assert.deepEqual(sumFibs(4), 5, 'message: <code>sumFibs(4)</code> should return 5');",
"expect(sumFibs(75024)).to.equal(60696);", "assert.deepEqual(sumFibs(75024), 60696, 'message: <code>sumFibs(75024)</code> should return 60696');",
"expect(sumFibs(75025)).to.equal(135721);" "assert.deepEqual(sumFibs(75025), 135721, 'message: <code>sumFibs(75025)</code> should return 135721');"
], ],
"MDNlinks": [ "MDNlinks": [
"Remainder" "Remainder"
@ -566,9 +566,9 @@
"sumPrimes(10);" "sumPrimes(10);"
], ],
"tests": [ "tests": [
"expect(sumPrimes(10)).to.be.a('number');", "assert.deepEqual(typeof(sumPrimes(10)), \"number\", \"The result should be a number\");",
"expect(sumPrimes(10)).to.equal(17);", "assert.deepEqual(sumPrimes(10), 17, 'message: <code>sumPrimes(10)</code> should return 17');",
"expect(sumPrimes(977)).to.equal(73156);" "assert.deepEqual(sumPrimes(977), 73156, 'message: <code>sumPrimes(977)</code> should return 73156');"
], ],
"MDNlinks": [ "MDNlinks": [
"For Loops", "For Loops",
@ -606,10 +606,10 @@
"smallestCommons([1,5]);" "smallestCommons([1,5]);"
], ],
"tests": [ "tests": [
"expect(smallestCommons([1,5])).to.be.a('number');", "assert.deepEqual(typeof(smallestCommons([1, 5])), \"number\", \"The result should be a number\");",
"expect(smallestCommons([1,5])).to.equal(60);", "assert.deepEqual(smallestCommons([1, 5]), 60, 'message: <code>smallestCommons([1, 5])</code> should return 60');",
"expect(smallestCommons([5,1])).to.equal(60);", "assert.deepEqual(smallestCommons([5, 1]), 60, 'message: <code>smallestCommons([5, 1])</code> should return 60');",
"expect(smallestCommons([1,13])).to.equal(360360);" "assert.deepEqual(smallestCommons([1, 13]), 360360, 'message: <code>smallestCommons([1, 13])</code> should return 360360');"
], ],
"MDNlinks": [ "MDNlinks": [
"Smallest Common Multiple" "Smallest Common Multiple"
@ -680,10 +680,10 @@
"drop([1, 2, 3], function(n) {return n < 3; });" "drop([1, 2, 3], function(n) {return n < 3; });"
], ],
"tests": [ "tests": [
"expect(drop([1, 2, 3, 4], function(n) {return n >= 3; })).to.eqls([3, 4]);", "assert.deepEqual(drop([1, 2, 3, 4], function(n) {return n>= 3;}), [3, 4], 'message: <code>drop([1, 2, 3, 4], function(n) {return n>= 3;})</code> should return [3, 4]');",
"expect(drop([1, 2, 3], function(n) {return n > 0; })).to.eqls([1, 2, 3]);", "assert.deepEqual(drop([1, 2, 3], function(n) {return n > 0; }), [1, 2, 3], 'message: <code>drop([1, 2, 3], function(n) {return n > 0; })</code> should return [1, 2, 3]');",
"expect(drop([1, 2, 3, 4], function(n) {return n > 5; })).to.eqls([]);", "assert.deepEqual(drop([1, 2, 3, 4], function(n) {return n > 5;}), [], 'message: <code>drop([1, 2, 3, 4], function(n) {return n > 5;})</code> should return []');",
"expect(drop([1, 2, 3, 7, 4], function(n) { return n > 5; })).to.eqls([7, 4]);" "assert.deepEqual(drop([1, 2, 3, 7, 4], function(n) {return n > 3}), [7, 4], 'message: <code>drop([1, 2, 3, 7, 4], function(n) {return n>= 3})</code> should return [7, 4]');"
], ],
"MDNlinks": [ "MDNlinks": [
"Arguments object", "Arguments object",
@ -757,8 +757,8 @@
"binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111');" "binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111');"
], ],
"tests": [ "tests": [
"expect(binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111')).to.equal(\"Aren't bonfires fun!?\");", "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()</code> should return Aren't bonfires fun!?\");",
"expect(binaryAgent('01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001')).to.equal(\"I love FreeCodeCamp!\");" "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!\", 'message: <code>binaryAgent()</code> should return \"I love FreeCodeCamp!\"');"
], ],
"MDNlinks": [ "MDNlinks": [
"String.charCodeAt()", "String.charCodeAt()",
@ -838,11 +838,11 @@
"add(2,3);" "add(2,3);"
], ],
"tests": [ "tests": [
"expect(add(2, 3)).to.equal(5);", "assert.deepEqual(add(2, 3), 5, 'message: <code>add(2, 3)</code> should return 5');",
"expect(add(2)(3)).to.equal(5);", "assert.deepEqual(add(2)(3), 5, 'message: <code>add(2)(3)</code> should return 5');",
"expect(add('http://bit.ly/IqT6zt')).to.be.undefined;", "assert.isUndefined(add(\"http://bit.ly/IqT6zt\"), 'message: <code>add(\"http://bit.ly/IqT6zt\")</code> should return undefined');",
"expect(add(2, '3')).to.be.undefined;", "assert.isUndefined(add(2, \"3\"), 'message: <code>add(2, \"3\")</code> should return undefined');",
"expect(add(2)([3])).to.be.undefined;" "assert.isUndefined(add(2)([3]), 'message: <code>add(2)([3])</code> should return undefined');"
], ],
"MDNlinks": [ "MDNlinks": [
"Global Function Object", "Global Function Object",