From ac6fe27430b4d6101b42799c2cc754930f87b5b9 Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Sun, 6 Sep 2015 13:15:44 +0530 Subject: [PATCH 01/20] Update tests for Bonfire Check for Palindromes - Replace expect with assert - Use strictEqual for checking equality of primitive - Add message to assert test cases - Minor modification to some existing test cases --- seed/challenges/basic-bonfires.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index 09a45fa1e4..e233947c70 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -135,17 +135,17 @@ "Remember to use Read-Search-Ask if you get stuck. Write your own code." ], "tests": [ - "expect(palindrome(\"eye\")).to.be.a(\"boolean\");", - "assert.deepEqual(palindrome(\"eye\"), true);", - "assert.deepEqual(palindrome(\"race car\"), true);", - "assert.deepEqual(palindrome(\"not a palindrome\"), false);", - "assert.deepEqual(palindrome(\"A man, a plan, a canal. Panama\"), true);", - "assert.deepEqual(palindrome(\"never odd or even\"), true);", - "assert.deepEqual(palindrome(\"nope\"), false);", - "assert.deepEqual(palindrome(\"almostomla\"), false);", - "assert.deepEqual(palindrome(\"My age is 0, 0 si ega ym.\"), true);", - "assert.deepEqual(palindrome(\"I'm 23 non 32 m'I?\"), true);", - "assert.deepEqual(palindrome(\"1 eye for of 1 eye.\"), false);" + "assert.isBoolean(palindrome(\"\"), \"palindrome() function returns a Boolean value\");", + "assert.strictEqual(palindrome(\"eye\"), true, \"\\\"eye\\\" is a palindrome\");", + "assert.strictEqual(palindrome(\"Race Car\"), true, \"\\\"Race Car\\\" is a palindrome\");", + "assert.strictEqual(palindrome(\"not a palindrome\"), false, \"\\\"not a palindrome\\\" is not a palindrome\");", + "assert.strictEqual(palindrome(\"A man, a plan, a canal. Panama\"), true, \"\\\"A man, a plan, a canal. Panama\\\" is a palindrome\");", + "assert.strictEqual(palindrome(\"Never odd OR even\"), true, \"\\\"Never odd OR even\\\" is a palindrome\");", + "assert.strictEqual(palindrome(\"Nope\"), false, \"\\\"Nope\\\" is not a palindrome\");", + "assert.strictEqual(palindrome(\"almostomla\"), false, \"\\\"almostomla\\\" is not a palindrome\");", + "assert.strictEqual(palindrome(\"My age is 0, 0 si ega ym.\"), true, \"\\\"My age is 0, 0 si ega ym.\\\" is a palindrome\");", + "assert.strictEqual(palindrome(\"I'm 23 non 32 m'I?\"), true, \"\\\"I'm 23 non 32 m'I?\\\" is a palindrome\");", + "assert.strictEqual(palindrome(\"1 eye for of 1 eye.\"), false, \"\\\"1 eye for of 1 eye.\\\" is not a palindrome\");" ], "challengeSeed": [ "function palindrome(str) {", From 50e32aa3f54267f8190413271ad086c139e5f5be Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Sun, 6 Sep 2015 04:50:36 +0530 Subject: [PATCH 02/20] Add test for Bonfire Check for Palindromes - Checks unicode characters between "Z" (capital Z) and "a" (small a)" such as "\" (forward slash) as punctuation. --- seed/challenges/basic-bonfires.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index e233947c70..d49a30581b 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -145,7 +145,8 @@ "assert.strictEqual(palindrome(\"almostomla\"), false, \"\\\"almostomla\\\" is not a palindrome\");", "assert.strictEqual(palindrome(\"My age is 0, 0 si ega ym.\"), true, \"\\\"My age is 0, 0 si ega ym.\\\" is a palindrome\");", "assert.strictEqual(palindrome(\"I'm 23 non 32 m'I?\"), true, \"\\\"I'm 23 non 32 m'I?\\\" is a palindrome\");", - "assert.strictEqual(palindrome(\"1 eye for of 1 eye.\"), false, \"\\\"1 eye for of 1 eye.\\\" is not a palindrome\");" + "assert.strictEqual(palindrome(\"1 eye for of 1 eye.\"), false, \"\\\"1 eye for of 1 eye.\\\" is not a palindrome\");", + "assert.strictEqual(palindrome(\"0_0 (: /-\\ :) 0-0\"), true, \"\\\"0_0 (: /-\\\\ :) 0-0\\\" is a palindrome\");" ], "challengeSeed": [ "function palindrome(str) {", From c043e370d9c59171ee397b2f60974dce4c86057c Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Sun, 6 Sep 2015 21:34:33 +0530 Subject: [PATCH 03/20] Restore emmet.io support close FreeCodeCamp/FreeCodeCamp#2720 --- client/commonFramework.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/commonFramework.js b/client/commonFramework.js index 3a6c8d911e..0a27245a2a 100644 --- a/client/commonFramework.js +++ b/client/commonFramework.js @@ -216,6 +216,14 @@ var allSeeds = ''; }); })(); +var defaultKeymap = { + 'Cmd-E': 'emmet.expand_abbreviation', + 'Tab': 'emmet.expand_abbreviation_with_tab', + 'Enter': 'emmet.insert_formatted_line_break_only' +}; + +emmetCodeMirror(editor, defaultKeymap); + editor.setOption('extraKeys', { Tab: function(cm) { if (cm.somethingSelected()) { From 1bfceb0aa69f8717644a62efe726aa9c24b0decb Mon Sep 17 00:00:00 2001 From: Timothy Cyrus Date: Sun, 6 Sep 2015 15:57:02 -0400 Subject: [PATCH 04/20] Update bootstrap.json Fixed tests in "Split your Bootstrap Row" and "Create Bootstrap Wells" based on #2548 --- seed/challenges/bootstrap.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seed/challenges/bootstrap.json b/seed/challenges/bootstrap.json index 4fb06d5ae5..23b7a92b25 100644 --- a/seed/challenges/bootstrap.json +++ b/seed/challenges/bootstrap.json @@ -1735,7 +1735,7 @@ "Create two div elements within your row, both with the class col-xs-6." ], "tests": [ - "assert($(\"div.row\").children(\"div.col-xs-6\").length > 1, 'Nest two div class=\"col-xs-6\" elements within your div class=\"row\" element.')", + "assert($(\"div.row > div.col-xs-6\").length > 1, 'Nest two div class=\"col-xs-6\" elements within your div class=\"row\" element.')", "assert(editor.match(/<\\/div>/g) && editor.match(/
/g).length === editor.match(/
div elements have closing tags.')" ], "challengeSeed": [ @@ -1769,8 +1769,8 @@ "Nest one div element with the class well within each of your col-xs-6 div elements." ], "tests": [ - "assert($(\"div\").length > 4, 'Add a div element with the class well inside each of your div class=\"col-xs-6\" elements')", - "assert($(\"div.col-xs-6 div.well\").length > 1, 'Nest both of your div class=\"col-xs-6\" elements within your div class=\"row\" element.')", + "assert($(\"div.col-xs-6\").not(\":has(>div.well)\").length < 1, 'Add a div element with the class well inside each of your div class=\"col-xs-6\" elements')", + "assert($(\"div.row > div.col-xs-6\").length > 1, 'Nest both of your div class=\"col-xs-6\" elements within your div class=\"row\" element.')", "assert(editor.match(/<\\/div>/g) && editor.match(/
/g).length === editor.match(/
div elements have closing tags.')" ], "challengeSeed": [ From b8dd3107bf6681997fd91a701e916573f9a3d835 Mon Sep 17 00:00:00 2001 From: natac13 Date: Sun, 6 Sep 2015 20:25:39 -0400 Subject: [PATCH 05/20] fix parenthesis in the description of first jquery challenge in the live version there is also duplicate tests the staging branch has 4 though. I am not to sure about this discrepancy closes #3133 --- seed/challenges/jquery.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index b3f44a1fc9..6023c47c2c 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -16,8 +16,8 @@ "tests": [ "assert(editor.match(/