most of the basic bonfires have running tests

pull/3304/head
Quincy Larson 2015-09-14 13:43:04 -07:00
parent 3d08496eb8
commit 98ed941384
2 changed files with 29 additions and 36 deletions

View File

@ -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&#40;&#41;</code> should return a number.');",
"assert(typeof(findLongestWord(\"The quick brown fox jumped over the lazy dog\")) === \"number\", '<code>findLongestWord&#40;&#41;</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&#40;&#41;</code> should return a string.');",
"assert(titleCase(\"I'm a little tea pot\") === \"I&#39;m A Little Tea Pot\", '<code>\"I'm a little tea pot\"</code> should return <code>\"I&#39;m A Little Tea Pot\"</code>.');",
"assert(typeof(titleCase(\"I&#39;m a little tea pot\")) === \"string\", '<code>titleCase&#40;&#41;</code> should return a string.');",
"assert(titleCase(\"I&#39;m a little tea pot\") === \"I&#39;m A Little Tea Pot\", '<code>\"I&#39;m a little tea pot\"</code> should return <code>\"I&#39;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&#40;&#41;</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&#44; 27&#44; 18&#44; 26]&#44; [4&#44; 5&#44; 1&#44; 3]&#44; [32&#44; 35&#44; 37&#44; 39]&#44; [1000&#44; 1001&#44; 857&#44; 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&#40;&#41;</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&#44; 27&#44; 18&#44; 26]&#44; [4&#44; 5&#44; 1&#44; 3]&#44; [32&#44; 35&#44; 37&#44; 39]&#44; [1000&#44; 1001&#44; 857&#44; 1]]</code> should return <code>[27&#44;5&#44;39&#44;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&#44; 9&#44; 1&#44; 3]&#44; [13&#44; 35&#44; 18&#44; 26]&#44; [32&#44; 35&#44; 97&#44; 39]&#44; [1000000&#44; 1001&#44; 857&#44; 1]]</code> should return <code>[9&#44; 35&#44; 97&#44; 1000000]</code>.');"
],
"MDNlinks": [
"Comparison Operators"
@ -312,9 +311,9 @@
"end(\"Bastian\", \"n\", \"\");"
],
"tests": [
"assert(end(\"Bastian\", \"n\") === true, '<code>end&#40;\"Bastian\"&#44; \"n\"&#41;</code> should return true.');",
"assert(end(\"Connor\", \"n\") === false, '<code>end&#40;\"Connor\"&#44; \"n\"&#41; </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.\"&#44; \"specification\"&#41;</code> should return false.');",
"assert(end(\"Bastian\", \"n\") === true, '<code>\"Bastian\"&#44; \"n\"</code> should return true.');",
"assert(end(\"Connor\", \"n\") === false, '<code>\"Connor\"&#44; \"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.\"&#44; \"specification\"&#41;</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\"&#44; \"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&#44; 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>\"*\"&#44; 3</code> should return <code>\"***\"</code>.);",
"assert(repeat(\"*\", 3) === \"***\", '<code>\"*\"&#44; 3</code> should return <code>\"***\"</code>.');",
"assert(repeat(\"abc\", 3) === \"abcabcabc\", '<code>\"abc\"&#44; 3</code> should return <code>\"abcabcabc\"</code>.');",
"assert(repeat(\"abc\", -2) === \"\", '<code>\"abc\"&#44; -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\"&#44; 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\"&#44; 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\"&#44; 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\"&#44; \"A-tisket a-tasket A green and yellow basket\".length&#41;</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\"&#44; \"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\"&#44; \"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&#44; 2&#44; 3]&#44; 2</code>&#44; [3] should return <code>[3]</code>.');",
"assert(slasher([1, 2, 3], 0) === [1, 2, 3]), '<code>[1&#44; 2&#44; 3]&#44; 0</code> should return <code>[1&#44; 2&#44; 3]</code>.');",
"assert(slasher([1, 2, 3], 9) === []), '<code>[1&#44; 2&#44; 3]&#44; 9</code> should return <code>[]</code>.');"
"assert(slasher([1, 2, 3], 2) === [3], '<code>[1&#44; 2&#44; 3]&#44; 2</code>&#44; [3] should return <code>[3]</code>.');",
"assert(slasher([1, 2, 3], 0) === [1, 2, 3], '<code>[1&#44; 2&#44; 3]&#44; 0</code> should return <code>[1&#44; 2&#44; 3]</code>.');",
"assert(slasher([1, 2, 3], 9) === [], '<code>[1&#44; 2&#44; 3]&#44; 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\"&#44; \"hey\"]</code> should return false.');",
"assert(mutation([\"hello\", \"Hello\"]) === true, '<code>[\"hello\"&#44; \"Hello\"]</code> should return true.');",
"assert(mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]) === true, '<code>[\"zyxwvutsrqponmlkjihgfedcba\"&#44; \"qrstu\"]</code> should return true.');",
"assert(mutation([\"Mary\", \"Army\"]) === true, '<code>[\"Mary\"&#44; \"Army\"]</code> should return true.');",
"assert(mutation([\"Mary\", \"Aarmy\"]) === true, '<code>[\"Mary\"&#44; \"Aarmy\"]</code> should return true.');",
"assert(mutation([\"Alien\", \"line\"]) === true, '<code>[\"Alien\"&#44; \"line\"]</code> should return true.');",
"assert(mutation([\"floor\", \"for\"]) === true, '<code>[\"floor\"&#44; \"for\"]</code> should return true.');",
"assert(mutation([\"hello\", \"neo\"]) === false, '<code>[\"hello\"&#44; \"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&#44; \"ate\"&#44; \"\"&#44; false&#44; 9]</code> should return <code>[7&#44; \"ate\"&#44; 9]</code>.');",
"assert(bouncer([\"a\", \"b\", \"c\"]) === [\"a\", \"b\", \"c\"], '<code>[\"a\"&#44; \"b\"&#44; \"c\"]</code> should return <code>[\"a\"&#44; \"b\"&#44; \"c\"]</code>.');",
"assert(bouncer([false, null, 0]) === [], '<code>[false&#44; null&#44; 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&#44; 2&#44; 3&#44; 1&#44; 2&#44; 3]&#44; 2&#44; 3</code> should return <code>[1&#44; 1]</code>.');",
"assert(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3) === [1, 5, 1], '<code>[1&#44; 2&#44; 3&#44; 5&#44; 1&#44; 2&#44; 3]&#44; 2&#44; 3</code> should return <code>[1&#44; 5&#44; 1]</code>.');",
"assert(destroyer([3, 5, 1, 2, 2], 2, 3, 5) === [1], '<code>[3&#44; 5&#44; 1&#44; 2&#44; 2]&#44; 2&#44; 3&#44; 5</code> should return <code>[1]</code>.');",
"assert(destroyer([2, 3, 2, 3], 2, 3) === [], '<code>[2&#44; 3&#44; 2&#44; 3]&#44; 2&#44; 3</code> should return <code>[]</code>.');",
@ -632,8 +631,8 @@
"tests": [
"assert(where([10, 20, 30, 40, 50], 35) === 3, '<code>[10&#44; 20&#44; 30&#44; 40&#44; 50]&#44; 35</code> should return <code>3</code>.');",
"assert(where([10, 20, 30, 40, 50], 30) === 2, '<code>[10&#44; 20&#44; 30&#44; 40&#44; 50]&#44; 30)</code> should return <code>2</code>.');",
"assert(where([40, 60], 50) === 1, '<code>[40&#44; 60&#44;]&#44; 50</code> should return <code>1</code>');",
"assert(where([5, 3, 20, 3], 3) === 0, '<code>[5&#44; 3&#44; 20&#44; 3]&#44; 3</code> should return <code>0</code>/');",
"assert(where([40, 60], 50) === 1, '<code>[40&#44; 60&#44;]&#44; 50</code> should return <code>1</code>.');",
"assert(where([5, 3, 20, 3], 3) === 0, '<code>[5&#44; 3&#44; 20&#44; 3]&#44; 3</code> should return <code>0</code>.');",
"assert(where([2, 20, 10], 1) === 0, '<code>[2&#44; 20&#44; 10]&#44; 1</code> should return <code>0</code>.');",
"assert(where([2, 5, 10], 15) === 3, '<code>[2&#44; 5&#44; 10]&#44; 15</code> should return <code>3</code>.');"
],

View File

@ -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