From 6c3e9af4786424d759c1cce53eb9bdde2ba9e120 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 1 Sep 2015 17:50:16 -0400 Subject: [PATCH 1/5] completed 3 --- koans/00--AboutExpects.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/koans/00--AboutExpects.js b/koans/00--AboutExpects.js index ac25196ff..d4354a4f3 100644 --- a/koans/00--AboutExpects.js +++ b/koans/00--AboutExpects.js @@ -4,14 +4,14 @@ var expect = require('chai').expect, describe("About Expects", function() { // We shall contemplate truth by testing reality, via spec expectations. it("should expect true", function() { - expect(FILL_ME_IN).to.be.true; //This should be true + expect(true).to.be.true; //This should be true }); // To understand reality, we must compare our expectations against reality. it("should expect equality", function () { var actual = 1 + 1; - expect(actual === FILL_ME_IN).to.be.true + expect(actual === 2).to.be.true }); // Some ways of asserting equality are better than others. @@ -19,7 +19,7 @@ describe("About Expects", function() { var actual = 1 + 1; // to.equal() compares using "strict" equality (===) - expect(actual).to.equal(FILL_ME_IN); + expect(actual).to.equal(2); }); // Sometimes you need to be really exact about what you "type." @@ -27,9 +27,9 @@ describe("About Expects", function() { var actual = (1 + 1).toString(); // use to.be.a() to check the type of a value - expect(actual).to.be.a(FILL_ME_IN); + expect(actual).to.be.a("String"); - expect(actual).to.be(1); // Fails? + expect(actual).to.be(2); // Fails? }); // Sometimes we will ask you to fill in the values. From 3baa6a4f287d237438f2aa858584ada363b43f50 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 1 Sep 2015 18:09:14 -0400 Subject: [PATCH 2/5] 3 changes completed --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a55e1bac9..ad7a446d0 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,6 @@ "dependencies": { "chai": "^3.2.0", "lodash": "^3.10.1", - "mocha": "^2.2.5" + "mocha": "^2.3.0" } } From 6953e89e52c63e43c329dbab3387ddfcb2058385 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 2 Sep 2015 17:55:56 -0400 Subject: [PATCH 3/5] changes from this afternoon --- koans/00--AboutExpects.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koans/00--AboutExpects.js b/koans/00--AboutExpects.js index d4354a4f3..6db9acff7 100644 --- a/koans/00--AboutExpects.js +++ b/koans/00--AboutExpects.js @@ -27,9 +27,9 @@ describe("About Expects", function() { var actual = (1 + 1).toString(); // use to.be.a() to check the type of a value - expect(actual).to.be.a("String"); + expect(actual).to.be.a(FILL_ME_IN); - expect(actual).to.be(2); // Fails? + expect(actual).to.be(1); // Fails? }); // Sometimes we will ask you to fill in the values. From 92eff740b24937645eb41fcaec7a2a03dab6085d Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 2 Sep 2015 18:13:37 -0400 Subject: [PATCH 4/5] finished 00 --- koans/00--AboutExpects.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/koans/00--AboutExpects.js b/koans/00--AboutExpects.js index 6db9acff7..5fcce5e95 100644 --- a/koans/00--AboutExpects.js +++ b/koans/00--AboutExpects.js @@ -27,13 +27,13 @@ describe("About Expects", function() { var actual = (1 + 1).toString(); // use to.be.a() to check the type of a value - expect(actual).to.be.a(FILL_ME_IN); + expect(actual).to.be.a('string'); - expect(actual).to.be(1); // Fails? + expect(actual).to.equal('2'); // Fails? }); // Sometimes we will ask you to fill in the values. it("should have filled in values", function () { - expect(1 + 1).to.equal(FILL_ME_IN); + expect(1 + 1).to.equal(2); }); }); From c9018b7ade0e213f2d8417edf994e5a1221f2a17 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 2 Sep 2015 18:37:07 -0400 Subject: [PATCH 5/5] saving game --- koans/01--AboutArrays.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/koans/01--AboutArrays.js b/koans/01--AboutArrays.js index 44b3f3119..5aa9299d9 100644 --- a/koans/01--AboutArrays.js +++ b/koans/01--AboutArrays.js @@ -7,10 +7,10 @@ describe("About Arrays", function() { it("should create arrays", function() { var emptyArray = []; - expect(typeof(emptyArray)).to.equal(FILL_ME_IN); + expect(typeof(emptyArray)).to.equal('object'); // A mistake? - http://javascript.crockford.com/remedial.html - expect(emptyArray.length).to.equal(FILL_ME_IN); + expect(emptyArray.length).to.equal(0); expect(emptyArray).to.be.empty; @@ -24,19 +24,19 @@ describe("About Arrays", function() { ]; // What is the value of each element? - expect(multiTypeArray[0]).to.equal(FILL_ME_IN); + expect(multiTypeArray[0]).to.equal(0); - expect(multiTypeArray[2]).to.equal(FILL_ME_IN); + expect(multiTypeArray[2]).to.equal('two'); // Careful, this one is tricky... explain why! - expect( multiTypeArray[3]() ).to.equal(FILL_ME_IN); + expect( multiTypeArray[3]() ).to.equal(3); - expect(multiTypeArray[4].value1).to.equal(FILL_ME_IN); + expect(multiTypeArray[4].value1).to.equal(4); // What are those brackets doing there? - expect(multiTypeArray[4]["value2"]).to.equal(FILL_ME_IN); + expect(multiTypeArray[4]["value2"]).to.equal(5); - expect(multiTypeArray[5][0]).to.equal(FILL_ME_IN); + expect(multiTypeArray[5][0]).to.equal(6); }); it("should understand array literals", function () {