From 98ed941384f485433afa2e81785db78ae7f5899e Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Mon, 14 Sep 2015 13:43:04 -0700 Subject: [PATCH] most of the basic bonfires have running tests --- seed/challenges/basic-bonfires.json | 59 +++++++++++++------------- server/views/coursewares/showHTML.jade | 6 --- 2 files changed, 29 insertions(+), 36 deletions(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index 8ff06201ee1..6acddd15180 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -145,7 +145,6 @@ "assert(palindrome(\"nope\") === false, '\"nope\" should return false.');", "assert(palindrome(\"almostomla\") === false, '\"almostomla\" should return false.');", "assert(palindrome(\"My age is 0, 0 si ega ym.\") === true, '\"My age is 0, 0 si ega ym.\" should return true.');", - "assert(palindrome(\"I'm 23 non 32 m'I?\") === true, '\"I'm 23 non 32 m'I?\" should return true.');", "assert(palindrome(\"1 eye for of 1 eye.\") === false, '\"1 eye for of 1 eye.\" should return false.');", "assert(palindrome(\"0_0 (: /-\\ :) 0-0\") === true, '\"0_0 (: /-\\\\ :) 0-0\" 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\", 'findLongestWord() should return a number.');", + "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.');", @@ -234,8 +233,8 @@ "titleCase(\"I'm a little tea pot\", \"\");" ], "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\", '\"I'm a little tea pot\" should return \"I'm A Little Tea Pot\".');", + "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\", '\"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\"');" ], @@ -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\", 'largestOfFour() 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], '[[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]] should return [27&344;5&344;39&344;1001].');", - "assert(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]) === [9,35,97,1000000], '[[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]] should return [9&344;35&344;97&344;1000000].');" + "assert(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]).constructor === Array, 'largestOfFour() 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], '[[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" @@ -312,9 +311,9 @@ "end(\"Bastian\", \"n\", \"\");" ], "tests": [ - "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, 'Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\") should return false.');", + "assert(end(\"Bastian\", \"n\") === true, '\"Bastian\", \"n\" should return true.');", + "assert(end(\"Connor\", \"n\") === false, '\"Connor\", \"n\" should return false.');", + "assert(end(\"Walking on water and developing software from a specification are easy if both are frozen.\", \"specification\") === false, '\"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, '\"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, '\"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.');" ], @@ -351,7 +350,7 @@ "repeat(\"abc\", 3, \"\");" ], "tests": [ - "assert(repeat(\"*\", 3) === \"***\", '\"*\", 3 should return \"***\".);", + "assert(repeat(\"*\", 3) === \"***\", '\"*\", 3 should return \"***\".');", "assert(repeat(\"abc\", 3) === \"abcabcabc\", '\"abc\", 3 should return \"abcabcabc\".');", "assert(repeat(\"abc\", -2) === \"\", '\"abc\", -2 should return \"\".');" ], @@ -390,9 +389,9 @@ ], "tests": [ "assert(truncate(\"A-tisket a-tasket A green and yellow basket\", 11) === \"A-tisket...\", '\"A-tisket a-tasket A green and yellow basket\", 1 should return \"A-tisket...\".');", - "assert(truncate(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", '\"Peter Piper picked a peck of pickled peppers\", 14 should return \"Peter Piper...\".);", + "assert(truncate(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", '\"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\", '\"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', '\"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\".);" + "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', '\"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()" @@ -465,9 +464,9 @@ "slasher([1, 2, 3], 2, \"\");" ], "tests": [ - "assert(slasher([1, 2, 3], 2) === [3]), '[1, 2, 3], 2, [3] should return [3].');", - "assert(slasher([1, 2, 3], 0) === [1, 2, 3]), '[1, 2, 3], 0 should return [1, 2, 3].');", - "assert(slasher([1, 2, 3], 9) === []), '[1, 2, 3], 9 should return [].');" + "assert(slasher([1, 2, 3], 2) === [3], '[1, 2, 3], 2, [3] should return [3].');", + "assert(slasher([1, 2, 3], 0) === [1, 2, 3], '[1, 2, 3], 0 should return [1, 2, 3].');", + "assert(slasher([1, 2, 3], 9) === [], '[1, 2, 3], 9 should return [].');" ], "MDNlinks": [ "Array.slice()", @@ -505,14 +504,14 @@ "mutation([\"hello\", \"hey\"], \"\");" ], "tests": [ - "assert(mutation([\"hello\", \"hey\"]) === false, '[\"hello\"&344; \"hey\"] should return false.');", - "assert(mutation([\"hello\", \"Hello\"]) === true, '[\"hello\"&344; \"Hello\"] should return true.');", - "assert(mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]) === true, '[\"zyxwvutsrqponmlkjihgfedcba\"&344; \"qrstu\"] should return true.');", - "assert(mutation([\"Mary\", \"Army\"]) === true, '[\"Mary\"&344; \"Army\"] should return true.');", - "assert(mutation([\"Mary\", \"Aarmy\"]) === true, '[\"Mary\"&344; \"Aarmy\"] should return true.');", - "assert(mutation([\"Alien\", \"line\"]) === true, '[\"Alien\"&344; \"line\"] should return true.');", - "assert(mutation([\"floor\", \"for\"]) === true, '[\"floor\"&344; \"for\"] should return true.');", - "assert(mutation([\"hello\", \"neo\"]) === false, '[\"hello\"&344; \"neo\"] should return false.');" + "assert(mutation([\"hello\", \"hey\"]) === false, '[\"hello\", \"hey\"] should return false.');", + "assert(mutation([\"hello\", \"Hello\"]) === true, '[\"hello\", \"Hello\"] should return true.');", + "assert(mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]) === true, '[\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"] should return true.');", + "assert(mutation([\"Mary\", \"Army\"]) === true, '[\"Mary\", \"Army\"] should return true.');", + "assert(mutation([\"Mary\", \"Aarmy\"]) === true, '[\"Mary\", \"Aarmy\"] should return true.');", + "assert(mutation([\"Alien\", \"line\"]) === true, '[\"Alien\", \"line\"] should return true.');", + "assert(mutation([\"floor\", \"for\"]) === true, '[\"floor\", \"for\"] should return true.');", + "assert(mutation([\"hello\", \"neo\"]) === false, '[\"hello\", \"neo\"] 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], '[7&344; \"ate\"&344; \"\"&344; false&344; 9] should return [7&344; \"ate\"&344; 9].');", - "assert(bouncer([\"a\", \"b\", \"c\"]) === [\"a\", \"b\", \"c\"], '[\"a\"&344; \"b\"&344; \"c\"] should return [\"a\"&344; \"b\"&344; \"c\"].');", - "assert(bouncer([false, null, 0]) === [], '[false&344; null&344; 0] should return [].');" + "assert(bouncer([7, \"ate\", \"\", false, 9]) === [7, \"ate\", 9], '[7, \"ate\", \"\", false, 9] should return [7, \"ate\", 9].');", + "assert(bouncer([\"a\", \"b\", \"c\"]) === [\"a\", \"b\", \"c\"], '[\"a\", \"b\", \"c\"] should return [\"a\", \"b\", \"c\"].');", + "assert(bouncer([false, null, 0]) === [], '[false, null, 0] should return [].');" ], "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], '[1&344; 2&344; 3&344; 1&344; 2&344; 3]&344; 2&344; 3 should return [1&344; 1]');", + "assert(destroyer([1, 2, 3, 1, 2, 3], 2, 3) === [1, 1], '[1, 2, 3, 1, 2, 3], 2, 3 should return [1, 1].');", "assert(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3) === [1, 5, 1], '[1, 2, 3, 5, 1, 2, 3], 2, 3 should return [1, 5, 1].');", "assert(destroyer([3, 5, 1, 2, 2], 2, 3, 5) === [1], '[3, 5, 1, 2, 2], 2, 3, 5 should return [1].');", "assert(destroyer([2, 3, 2, 3], 2, 3) === [], '[2, 3, 2, 3], 2, 3 should return [].');", @@ -632,8 +631,8 @@ "tests": [ "assert(where([10, 20, 30, 40, 50], 35) === 3, '[10, 20, 30, 40, 50], 35 should return 3.');", "assert(where([10, 20, 30, 40, 50], 30) === 2, '[10, 20, 30, 40, 50], 30) should return 2.');", - "assert(where([40, 60], 50) === 1, '[40, 60,], 50 should return 1');", - "assert(where([5, 3, 20, 3], 3) === 0, '[5, 3, 20, 3], 3 should return 0/');", + "assert(where([40, 60], 50) === 1, '[40, 60,], 50 should return 1.');", + "assert(where([5, 3, 20, 3], 3) === 0, '[5, 3, 20, 3], 3 should return 0.');", "assert(where([2, 20, 10], 1) === 0, '[2, 20, 10], 1 should return 0.');", "assert(where([2, 5, 10], 15) === 3, '[2, 5, 10], 15 should return 3.');" ], diff --git a/server/views/coursewares/showHTML.jade b/server/views/coursewares/showHTML.jade index 699355924cc..7b83db41688 100644 --- a/server/views/coursewares/showHTML.jade +++ b/server/views/coursewares/showHTML.jade @@ -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