From 817276ab9623c1f92abbf94353f41fafdbb8a7ff Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Mon, 17 Aug 2015 02:18:27 +0530 Subject: [PATCH 1/3] Added test cases for Bonfire: Where do I belong Checks for proper positioning of element based on proper sorting order. --- seed/challenges/basic-bonfires.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index 6f1cf7b9d4..1712f90492 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -664,7 +664,11 @@ ], "tests": [ "expect(where([10, 20, 30, 40, 50], 35)).to.equal(3);", - "expect(where([10, 20, 30, 40, 50], 30)).to.equal(2);" + "expect(where([10, 20, 30, 40, 50], 30)).to.equal(2);", + "expect(where([40, 60], 50)).to.equal(1);", + "expect(where([5, 3, 20, 3], 3)).to.equal(0);", + "expect(where([2, 20, 10], 1)).to.equal(0);", + "expect(where([2, 5, 10], 15)).to.equal(3);" ], "type": "bonfire", "challengeType": 5, From 7e495338c458327285c351a6c3cc15e4a0b230bb Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Sun, 30 Aug 2015 13:36:39 +0530 Subject: [PATCH 2/3] Replace expect with assert --- seed/challenges/basic-bonfires.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index a6ea1d9310..711a9bbaf6 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -667,12 +667,12 @@ "Array.sort()" ], "tests": [ - "expect(where([10, 20, 30, 40, 50], 35)).to.equal(3);", - "expect(where([10, 20, 30, 40, 50], 30)).to.equal(2);", - "expect(where([40, 60], 50)).to.equal(1);", - "expect(where([5, 3, 20, 3], 3)).to.equal(0);", - "expect(where([2, 20, 10], 1)).to.equal(0);", - "expect(where([2, 5, 10], 15)).to.equal(3);" + "assert.strictEqual(where([10, 20, 30, 40, 50], 35), 3, '35 should be placed at index 3');", + "assert.strictEqual(where([10, 20, 30, 40, 50], 30), 2, '30 should be placed at index 2');", + "assert.strictEqual(where([40, 60], 50), 1, '50 should be placed at index 1');", + "assert.strictEqual(where([5, 3, 20, 3], 3), 0, '3 should be placed at index 0');", + "assert.strictEqual(where([2, 20, 10], 1), 0, '1 should be placed at index 1');", + "assert.strictEqual(where([2, 5, 10], 15), 3, '15 should be placed at index 3');" ], "type": "bonfire", "challengeType": 5, From 90c44651a66fd09679313a75b560a4bda718ca39 Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Sun, 30 Aug 2015 20:32:25 +0530 Subject: [PATCH 3/3] Correct assert statement --- seed/challenges/basic-bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index 711a9bbaf6..480b927d41 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -671,7 +671,7 @@ "assert.strictEqual(where([10, 20, 30, 40, 50], 30), 2, '30 should be placed at index 2');", "assert.strictEqual(where([40, 60], 50), 1, '50 should be placed at index 1');", "assert.strictEqual(where([5, 3, 20, 3], 3), 0, '3 should be placed at index 0');", - "assert.strictEqual(where([2, 20, 10], 1), 0, '1 should be placed at index 1');", + "assert.strictEqual(where([2, 20, 10], 1), 0, '1 should be placed at index 0');", "assert.strictEqual(where([2, 5, 10], 15), 3, '15 should be placed at index 3');" ], "type": "bonfire",