finish QAing all bonfires
parent
4fffabfe8f
commit
16c0c23b2c
|
@ -179,28 +179,28 @@
|
|||
"",
|
||||
"// Example inventory lists",
|
||||
"var curInv = [",
|
||||
" [21, 'Bowling Ball'],",
|
||||
" [2, 'Dirty Sock'],",
|
||||
" [1, 'Hair Pin'],",
|
||||
" [5, 'Microphone']",
|
||||
" [21, \"Bowling Ball\"],",
|
||||
" [2, \"Dirty Sock\"],",
|
||||
" [1, \"Hair Pin\"],",
|
||||
" [5, \"Microphone\"]",
|
||||
"];",
|
||||
"",
|
||||
"var newInv = [",
|
||||
" [2, 'Hair Pin'],",
|
||||
" [3, 'Half-Eaten Apple'],",
|
||||
" [67, 'Bowling Ball'],",
|
||||
" [7, 'Toothpaste']",
|
||||
" [2, \"Hair Pin\"],",
|
||||
" [3, \"Half-Eaten Apple\"],",
|
||||
" [67, \"Bowling Ball\"],",
|
||||
" [7, \"Toothpaste\"]",
|
||||
"];",
|
||||
"",
|
||||
"inventory(curInv, newInv);"
|
||||
],
|
||||
"tests": [
|
||||
"assert.isArray(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), 'message: <code>inventory()</code> should return an array.');",
|
||||
"assert.equal(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]).length, 6, 'message: <code>inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]).length</code> should return an array with a length of 6.');",
|
||||
"assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']], 'message: <code>inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']])</code> should return <code>[[88, 'Bowling Ball'], [2, 'Dirty Sock'], [3, 'Hair Pin'], [3, 'Half-Eaten Apple'], [5, 'Microphone'], [7, 'Toothpaste']]</code>.');",
|
||||
"assert.deepEqual(inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], []), [[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], 'message: <code>inventory([[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']], [])</code> should return <code>[[21, 'Bowling Ball'], [2, 'Dirty Sock'], [1, 'Hair Pin'], [5, 'Microphone']]</code>.);",
|
||||
"assert.deepEqual(inventory([], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']]), [[67, 'Bowling Ball'], [2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [7, 'Toothpaste']], 'message: <code>inventory([], [[2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [67, 'Bowling Ball'], [7, 'Toothpaste']])</code> should return <code>[[67, 'Bowling Ball'], [2, 'Hair Pin'], [3, 'Half-Eaten Apple'], [7, 'Toothpaste']]</code>.');",
|
||||
"assert.deepEqual(inventory([[0, 'Bowling Ball'], [0, 'Dirty Sock'], [0, 'Hair Pin'], [0, 'Microphone']], [[1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [1, 'Bowling Ball'], [1, 'Toothpaste']]), [[1, 'Bowling Ball'], [0, 'Dirty Sock'], [1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [0, 'Microphone'], [1, 'Toothpaste']], 'message: <code>inventory([[0, 'Bowling Ball'], [0, 'Dirty Sock'], [0, 'Hair Pin'], [0, 'Microphone']], [[1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [1, 'Bowling Ball'], [1, 'Toothpaste']])</code> should return <code>[[1, 'Bowling Ball'], [0, 'Dirty Sock'], [1, 'Hair Pin'], [1, 'Half-Eaten Apple'], [0, 'Microphone'], [1, 'Toothpaste']]</code>.');"
|
||||
"assert.isArray(inventory([[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], [[2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [67, \"Bowling Ball\"], [7, \"Toothpaste\"]]), 'message: <code>inventory()</code> should return an array.');",
|
||||
"assert.equal(inventory([[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], [[2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [67, \"Bowling Ball\"], [7, \"Toothpaste\"]]).length, 6, 'message: <code>inventory([[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], [[2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [67, \"Bowling Ball\"], [7, \"Toothpaste\"]]).length</code> should return an array with a length of 6.');",
|
||||
"assert.deepEqual(inventory([[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], [[2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [67, \"Bowling Ball\"], [7, \"Toothpaste\"]]), [[88, \"Bowling Ball\"], [2, \"Dirty Sock\"], [3, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [5, \"Microphone\"], [7, \"Toothpaste\"]], 'message: <code>inventory([[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], [[2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [67, \"Bowling Ball\"], [7, \"Toothpaste\"]])</code> should return <code>[[88, \"Bowling Ball\"], [2, \"Dirty Sock\"], [3, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [5, \"Microphone\"], [7, \"Toothpaste\"]]</code>.');",
|
||||
"assert.deepEqual(inventory([[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], []), [[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], 'message: <code>inventory([[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]], [])</code> should return <code>[[21, \"Bowling Ball\"], [2, \"Dirty Sock\"], [1, \"Hair Pin\"], [5, \"Microphone\"]]</code>.');",
|
||||
"assert.deepEqual(inventory([], [[2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [67, \"Bowling Ball\"], [7, \"Toothpaste\"]]), [[67, \"Bowling Ball\"], [2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [7, \"Toothpaste\"]], 'message: <code>inventory([], [[2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [67, \"Bowling Ball\"], [7, \"Toothpaste\"]])</code> should return <code>[[67, \"Bowling Ball\"], [2, \"Hair Pin\"], [3, \"Half-Eaten Apple\"], [7, \"Toothpaste\"]]</code>.');",
|
||||
"assert.deepEqual(inventory([[0, \"Bowling Ball\"], [0, \"Dirty Sock\"], [0, \"Hair Pin\"], [0, \"Microphone\"]], [[1, \"Hair Pin\"], [1, \"Half-Eaten Apple\"], [1, \"Bowling Ball\"], [1, \"Toothpaste\"]]), [[1, \"Bowling Ball\"], [0, \"Dirty Sock\"], [1, \"Hair Pin\"], [1, \"Half-Eaten Apple\"], [0, \"Microphone\"], [1, \"Toothpaste\"]], 'message: <code>inventory([[0, \"Bowling Ball\"], [0, \"Dirty Sock\"], [0, \"Hair Pin\"], [0, \"Microphone\"]], [[1, \"Hair Pin\"], [1, \"Half-Eaten Apple\"], [1, \"Bowling Ball\"], [1, \"Toothpaste\"]])</code> should return <code>[[1, \"Bowling Ball\"], [0, \"Dirty Sock\"], [1, \"Hair Pin\"], [1, \"Half-Eaten Apple\"], [0, \"Microphone\"], [1, \"Toothpaste\"]]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Global Array Object"
|
||||
|
|
|
@ -151,9 +151,8 @@
|
|||
],
|
||||
"tests": [
|
||||
"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 }], 'message: <code>where([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 })</code> should return <code>[{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }]</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 }], 'message: <code>where([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"b\": 2 })</code> should return <code>[{ \"a\": 1, \"b\": 2 }, { \"a\": 1, \"b\": 2, \"c\": 2 }]</code>.');",
|
||||
"assert.deepEqual(where([{ \"a\": 5 }, { \"b\": 10 }, { \"a\": 5, \"b\": 10 }], { \"a\": 5, \"b\": 10 }), [{ \"a\": 5, \"b\": 10 }], 'message: <code>where([{ \"a\": 5 }, { \"b\": 10 }, { \"a\": 5, \"b\": 10 }], { \"a\": 5, \"b\": 10 })</code> should return <code>[{ \"a\": 5, \"b\": 10 }]</code>.');"
|
||||
"assert.deepEqual(where([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 }), [{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], 'message: <code>where([{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }], { \"a\": 1 })</code> should return <code>[{ \"a\": 1 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2 }]</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 }], 'message: <code>where([{ \"a\": 1, \"b\": 2 }, { \"a\": 1 }, { \"a\": 1, \"b\": 2, \"c\": 2 }], { \"a\": 1, \"b\": 2 })</code> should return <code>[{ \"a\": 1, \"b\": 2 }, { \"a\": 1, \"b\": 2, \"c\": 2 }]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Global Object",
|
||||
|
@ -442,13 +441,13 @@
|
|||
"convert(\"Dolce & Gabbana\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert.match(convert(\"Dolce & Gabbana\"), /Dolce & Gabbana/, 'message: <code>convert(\"Dolce & Gabbana\")</code> should return <code>Dolce & Gabbana</code>.');",
|
||||
"assert.match(convert(\"Hamburgers < Pizza < Tacos\"), /Hamburgers < Pizza < Tacos/, 'message: <code>convert(\"Hamburgers < Pizza < Tacos\")</code> should return <code>Hamburgers < Pizza < Tacos</code>.');",
|
||||
"assert.match(convert(\"Sixty > twelve\"), /Sixty > twelve/, 'message: <code>convert(\"Sixty > twelve\")</code> should return <code>Sixty > twelve</code>.');",
|
||||
"assert.match(convert('Stuff in \"quotation marks\"'), /Stuff in "quotation marks"/, 'message: <code>convert('Stuff in \"quotation marks\"')</code> should return <code>Stuff in "quotation marks"</code>.');",
|
||||
"assert.match(convert(\"Shindler's List\"), /Shindler's List/, 'message: <code>convert(\"Shindler's List\")</code> should return <code>Shindler's List</code>.');",
|
||||
"assert.match(convert('<>'), /<>/, 'message: <code>convert('<>')</code> should return <code><></code>.');",
|
||||
"assert.strictEqual(convert('abc'), 'abc', 'message: <code>convert(\"abc\")</code> should return <code>\"abc\"</code>.');"
|
||||
"assert.match(convert(\"Dolce & Gabbana\"), /Dolce & Gabbana/, 'message: <code>convert(\"Dolce & Gabbana\")</code> should return <code>Dolce &​amp; Gabbana</code>.');",
|
||||
"assert.match(convert(\"Hamburgers < Pizza < Tacos\"), /Hamburgers < Pizza < Tacos/, 'message: <code>convert(\"Hamburgers < Pizza < Tacos\")</code> should return <code>Hamburgers &​lt; Pizza &​lt; Tacos</code>.');",
|
||||
"assert.match(convert(\"Sixty > twelve\"), /Sixty > twelve/, 'message: <code>convert(\"Sixty > twelve\")</code> should return <code>Sixty &​gt; twelve</code>.');",
|
||||
"assert.match(convert('Stuff in \"quotation marks\"'), /Stuff in "quotation marks"/, 'message: <code>convert('Stuff in \"quotation marks\"')</code> should return <code>Stuff in &​quot;quotation marks&​quot;</code>.');",
|
||||
"assert.match(convert(\"Shindler's List\"), /Shindler's List/, 'message: <code>convert(\"Shindler's List\")</code> should return <code>Shindler&​apos;s List</code>.');",
|
||||
"assert.match(convert('<>'), /<>/, 'message: <code>convert(\"<>\")</code> should return <code>&​lt;&​gt;</code>.');",
|
||||
"assert.strictEqual(convert('abc'), 'abc', 'message: <code>convert(\"abc\")</code> should return <code>abc</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"RegExp",
|
||||
|
|
Loading…
Reference in New Issue