most of the basic bonfires have running tests
parent
3d08496eb8
commit
98ed941384
|
@ -145,7 +145,6 @@
|
|||
"assert(palindrome(\"nope\") === false, '<code>\"nope\"</code> should return false.');",
|
||||
"assert(palindrome(\"almostomla\") === false, '<code>\"almostomla\"</code> should return false.');",
|
||||
"assert(palindrome(\"My age is 0, 0 si ega ym.\") === true, '<code>\"My age is 0, 0 si ega ym.\"</code> should return true.');",
|
||||
"assert(palindrome(\"I'm 23 non 32 m'I?\") === true, '<code>\"I'm 23 non 32 m'I?\"</code> should return true.');",
|
||||
"assert(palindrome(\"1 eye for of 1 eye.\") === false, '<code>\"1 eye for of 1 eye.\"</code> should return false.');",
|
||||
"assert(palindrome(\"0_0 (: /-\\ :) 0-0\") === true, '<code>\"0_0 (: /-\\\\ :) 0-0\"</code> should return true.');"
|
||||
],
|
||||
|
@ -193,7 +192,7 @@
|
|||
"findLongestWord(\"The quick brown fox jumped over the lazy dog\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeOf(findLongestWord(\"The quick brown fox jumped over the lazy dog\")) === \"number\", '<code>findLongestWord()</code> should return a number.');",
|
||||
"assert(typeof(findLongestWord(\"The quick brown fox jumped over the lazy dog\")) === \"number\", '<code>findLongestWord()</code> should return a number.');",
|
||||
"assert(findLongestWord(\"The quick brown fox jumped over the lazy dog\") === 6, '<code>\"The quick brown fox jumped over the lazy dog\"</code> should return <code>6</code>.');",
|
||||
"assert(findLongestWord(\"May the force be with you\") === 5, '<code>\"May the force be with you\"</code> should return <code>5</code>.');",
|
||||
"assert(findLongestWord(\"Google do a barrel roll\") === 6, '<code>\"Google do a barrel roll\"</code> should return <code>6</code>.');",
|
||||
|
@ -234,8 +233,8 @@
|
|||
"titleCase(\"I'm a little tea pot\", \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeOf(titleCase(\"I'm a little tea pot\")) === \"String\", '<code>titleCase()</code> should return a string.');",
|
||||
"assert(titleCase(\"I'm a little tea pot\") === \"I'm A Little Tea Pot\", '<code>\"I'm a little tea pot\"</code> should return <code>\"I'm A Little Tea Pot\"</code>.');",
|
||||
"assert(typeof(titleCase(\"I'm a little tea pot\")) === \"string\", '<code>titleCase()</code> should return a string.');",
|
||||
"assert(titleCase(\"I'm a little tea pot\") === \"I'm A Little Tea Pot\", '<code>\"I'm a little tea pot\"</code> should return <code>\"I'm A Little Tea Pot\"</code>.');",
|
||||
"assert(titleCase(\"sHoRt AnD sToUt\") === \"Short And Stout\", '<code>\"sHoRt AnD sToUt\"</code> should return <code>\"Short And Stout\"</code>.');",
|
||||
"assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", '<code>\"HERE IS MY HANDLE HERE IS MY SPOUT\"</code> should return <code>\"Here Is My Handle Here Is My Spout\"</code>');"
|
||||
],
|
||||
|
@ -274,9 +273,9 @@
|
|||
"largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]], \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeOf(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])) === \"array\", '<code>largestOfFour()</code> should return an array.');",
|
||||
"(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]) === [27,5,39,1001], '<code>[[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]</code> should return <code>[27&344;5&344;39&344;1001]</code>.');",
|
||||
"assert(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]) === [9,35,97,1000000], '<code>[[4&344; 9&344; 1&344; 3]&344; [13&344; 35&344; 18&344; 26]&344; [32&344; 35&344; 97&344; 39]&344; [1000000&344; 1001&344; 857&344; 1]]</code> should return <code>[9&344;35&344;97&344;1000000]</code>.');"
|
||||
"assert(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]).constructor === Array, '<code>largestOfFour()</code> should return an array.');",
|
||||
"assert(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]) === [27,5,39,1001], '<code>[[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]</code> should return <code>[27,5,39,1001]</code>.');",
|
||||
"assert(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]) === [9,35,97,1000000], '<code>[[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]</code> should return <code>[9, 35, 97, 1000000]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Comparison Operators"
|
||||
|
@ -312,9 +311,9 @@
|
|||
"end(\"Bastian\", \"n\", \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(end(\"Bastian\", \"n\") === true, '<code>end(\"Bastian\", \"n\")</code> should return true.');",
|
||||
"assert(end(\"Connor\", \"n\") === false, '<code>end(\"Connor\", \"n\") </code> should return false.');",
|
||||
"assert(end(\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\") === false, '<code>Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\")</code> should return false.');",
|
||||
"assert(end(\"Bastian\", \"n\") === true, '<code>\"Bastian\", \"n\"</code> should return true.');",
|
||||
"assert(end(\"Connor\", \"n\") === false, '<code>\"Connor\", \"n\"</code> should return false.');",
|
||||
"assert(end(\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\") === false, '<code>\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\")</code> should return false.');",
|
||||
"assert(end(\"He has to give me a new name\", \"name\") === true, '<code>\"He has to give me a new name\", \"name\"</code> 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, '<code>\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\"</code> should return false.');"
|
||||
],
|
||||
|
@ -351,7 +350,7 @@
|
|||
"repeat(\"abc\", 3, \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(repeat(\"*\", 3) === \"***\", '<code>\"*\", 3</code> should return <code>\"***\"</code>.);",
|
||||
"assert(repeat(\"*\", 3) === \"***\", '<code>\"*\", 3</code> should return <code>\"***\"</code>.');",
|
||||
"assert(repeat(\"abc\", 3) === \"abcabcabc\", '<code>\"abc\", 3</code> should return <code>\"abcabcabc\"</code>.');",
|
||||
"assert(repeat(\"abc\", -2) === \"\", '<code>\"abc\", -2</code> should return <code>\"\"</code>.');"
|
||||
],
|
||||
|
@ -390,9 +389,9 @@
|
|||
],
|
||||
"tests": [
|
||||
"assert(truncate(\"A-tisket a-tasket A green and yellow basket\", 11) === \"A-tisket...\", '<code>\"A-tisket a-tasket A green and yellow basket\", 1</code> should return <code>\"A-tisket...\"</code>.');",
|
||||
"assert(truncate(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", '<code>\"Peter Piper picked a peck of pickled peppers\", 14</code> should return <code>\"Peter Piper...\"</code>.);",
|
||||
"assert(truncate(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", '<code>\"Peter Piper picked a peck of pickled peppers\", 14</code> should return <code>\"Peter Piper...\"</code>.');",
|
||||
"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\", '<code>\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length)</code> should return <code>\"A-tisket a-tasket A green and yellow basket\"</code>.');",
|
||||
"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', '<code>\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length + 2</code> should return <code>\"A-tisket a-tasket A green and yellow basket\"</code>.);"
|
||||
"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', '<code>\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length + 2</code> should return <code>\"A-tisket a-tasket A green and yellow basket\"</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"String.slice()"
|
||||
|
@ -465,9 +464,9 @@
|
|||
"slasher([1, 2, 3], 2, \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(slasher([1, 2, 3], 2) === [3]), '<code>[1, 2, 3], 2</code>, [3] should return <code>[3]</code>.');",
|
||||
"assert(slasher([1, 2, 3], 0) === [1, 2, 3]), '<code>[1, 2, 3], 0</code> should return <code>[1, 2, 3]</code>.');",
|
||||
"assert(slasher([1, 2, 3], 9) === []), '<code>[1, 2, 3], 9</code> should return <code>[]</code>.');"
|
||||
"assert(slasher([1, 2, 3], 2) === [3], '<code>[1, 2, 3], 2</code>, [3] should return <code>[3]</code>.');",
|
||||
"assert(slasher([1, 2, 3], 0) === [1, 2, 3], '<code>[1, 2, 3], 0</code> should return <code>[1, 2, 3]</code>.');",
|
||||
"assert(slasher([1, 2, 3], 9) === [], '<code>[1, 2, 3], 9</code> should return <code>[]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Array.slice()",
|
||||
|
@ -505,14 +504,14 @@
|
|||
"mutation([\"hello\", \"hey\"], \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(mutation([\"hello\", \"hey\"]) === false, '<code>[\"hello\"&344; \"hey\"]</code> should return false.');",
|
||||
"assert(mutation([\"hello\", \"Hello\"]) === true, '<code>[\"hello\"&344; \"Hello\"]</code> should return true.');",
|
||||
"assert(mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]) === true, '<code>[\"zyxwvutsrqponmlkjihgfedcba\"&344; \"qrstu\"]</code> should return true.');",
|
||||
"assert(mutation([\"Mary\", \"Army\"]) === true, '<code>[\"Mary\"&344; \"Army\"]</code> should return true.');",
|
||||
"assert(mutation([\"Mary\", \"Aarmy\"]) === true, '<code>[\"Mary\"&344; \"Aarmy\"]</code> should return true.');",
|
||||
"assert(mutation([\"Alien\", \"line\"]) === true, '<code>[\"Alien\"&344; \"line\"]</code> should return true.');",
|
||||
"assert(mutation([\"floor\", \"for\"]) === true, '<code>[\"floor\"&344; \"for\"]</code> should return true.');",
|
||||
"assert(mutation([\"hello\", \"neo\"]) === false, '<code>[\"hello\"&344; \"neo\"]</code> should return false.');"
|
||||
"assert(mutation([\"hello\", \"hey\"]) === false, '<code>[\"hello\", \"hey\"]</code> should return false.');",
|
||||
"assert(mutation([\"hello\", \"Hello\"]) === true, '<code>[\"hello\", \"Hello\"]</code> should return true.');",
|
||||
"assert(mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]) === true, '<code>[\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]</code> should return true.');",
|
||||
"assert(mutation([\"Mary\", \"Army\"]) === true, '<code>[\"Mary\", \"Army\"]</code> should return true.');",
|
||||
"assert(mutation([\"Mary\", \"Aarmy\"]) === true, '<code>[\"Mary\", \"Aarmy\"]</code> should return true.');",
|
||||
"assert(mutation([\"Alien\", \"line\"]) === true, '<code>[\"Alien\", \"line\"]</code> should return true.');",
|
||||
"assert(mutation([\"floor\", \"for\"]) === true, '<code>[\"floor\", \"for\"]</code> should return true.');",
|
||||
"assert(mutation([\"hello\", \"neo\"]) === false, '<code>[\"hello\", \"neo\"]</code> should return false.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Array.indexOf()"
|
||||
|
@ -548,9 +547,9 @@
|
|||
"bouncer([7, \"ate\", \"\", false, 9], \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(bouncer([7, \"ate\", \"\", false, 9]) === [7, \"ate\", 9], '<code>[7&344; \"ate\"&344; \"\"&344; false&344; 9]</code> should return <code>[7&344; \"ate\"&344; 9]</code>.');",
|
||||
"assert(bouncer([\"a\", \"b\", \"c\"]) === [\"a\", \"b\", \"c\"], '<code>[\"a\"&344; \"b\"&344; \"c\"]</code> should return <code>[\"a\"&344; \"b\"&344; \"c\"]</code>.');",
|
||||
"assert(bouncer([false, null, 0]) === [], '<code>[false&344; null&344; 0]</code> should return <code>[]</code>.');"
|
||||
"assert(bouncer([7, \"ate\", \"\", false, 9]) === [7, \"ate\", 9], '<code>[7, \"ate\", \"\", false, 9]</code> should return <code>[7, \"ate\", 9]</code>.');",
|
||||
"assert(bouncer([\"a\", \"b\", \"c\"]) === [\"a\", \"b\", \"c\"], '<code>[\"a\", \"b\", \"c\"]</code> should return <code>[\"a\", \"b\", \"c\"]</code>.');",
|
||||
"assert(bouncer([false, null, 0]) === [], '<code>[false, null, 0]</code> should return <code>[]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Boolean Objects",
|
||||
|
@ -586,7 +585,7 @@
|
|||
"destroyer([1, 2, 3, 1, 2, 3], 2, 3, \"\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(destroyer([1, 2, 3, 1, 2, 3], 2, 3) === [1, 1], '<code>[1&344; 2&344; 3&344; 1&344; 2&344; 3]&344; 2&344; 3</code> should return <code>[1&344; 1]</code>');",
|
||||
"assert(destroyer([1, 2, 3, 1, 2, 3], 2, 3) === [1, 1], '<code>[1, 2, 3, 1, 2, 3], 2, 3</code> should return <code>[1, 1]</code>.');",
|
||||
"assert(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3) === [1, 5, 1], '<code>[1, 2, 3, 5, 1, 2, 3], 2, 3</code> should return <code>[1, 5, 1]</code>.');",
|
||||
"assert(destroyer([3, 5, 1, 2, 2], 2, 3, 5) === [1], '<code>[3, 5, 1, 2, 2], 2, 3, 5</code> should return <code>[1]</code>.');",
|
||||
"assert(destroyer([2, 3, 2, 3], 2, 3) === [], '<code>[2, 3, 2, 3], 2, 3</code> should return <code>[]</code>.');",
|
||||
|
@ -632,8 +631,8 @@
|
|||
"tests": [
|
||||
"assert(where([10, 20, 30, 40, 50], 35) === 3, '<code>[10, 20, 30, 40, 50], 35</code> should return <code>3</code>.');",
|
||||
"assert(where([10, 20, 30, 40, 50], 30) === 2, '<code>[10, 20, 30, 40, 50], 30)</code> should return <code>2</code>.');",
|
||||
"assert(where([40, 60], 50) === 1, '<code>[40, 60,], 50</code> should return <code>1</code>');",
|
||||
"assert(where([5, 3, 20, 3], 3) === 0, '<code>[5, 3, 20, 3], 3</code> should return <code>0</code>/');",
|
||||
"assert(where([40, 60], 50) === 1, '<code>[40, 60,], 50</code> should return <code>1</code>.');",
|
||||
"assert(where([5, 3, 20, 3], 3) === 0, '<code>[5, 3, 20, 3], 3</code> should return <code>0</code>.');",
|
||||
"assert(where([2, 20, 10], 1) === 0, '<code>[2, 20, 10], 1</code> should return <code>0</code>.');",
|
||||
"assert(where([2, 5, 10], 15) === 3, '<code>[2, 5, 10], 15</code> should return <code>3</code>.');"
|
||||
],
|
||||
|
|
|
@ -86,7 +86,6 @@ block content
|
|||
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
||||
.modal-body
|
||||
.text-center
|
||||
<<<<<<< HEAD
|
||||
#checkmark-container.row
|
||||
#challenge-checkmark.animated.zoomInDown.delay-half
|
||||
span.completion-icon.ion-checkmark-circled.text-primary
|
||||
|
@ -95,9 +94,4 @@ block content
|
|||
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to my next challenge (ctrl + enter)
|
||||
else
|
||||
a.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge
|
||||
=======
|
||||
.animated.zoomInDown
|
||||
span.completion-icon.ion-checkmark-circled.text-primary
|
||||
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
|
||||
>>>>>>> 45e8cef504bada71c3fa805b8e0422208299eada
|
||||
include ../partials/challenge-modals
|
||||
|
|
Loading…
Reference in New Issue