From 3cbeab8db1eb00b0068ff35d3ea969061ace43d0 Mon Sep 17 00:00:00 2001 From: gbaik Date: Sat, 10 Jun 2017 21:08:23 -0700 Subject: [PATCH 1/4] Add completed about_asserts --- topics/about_asserts.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/topics/about_asserts.js b/topics/about_asserts.js index baf7fc75..a2146770 100644 --- a/topics/about_asserts.js +++ b/topics/about_asserts.js @@ -2,13 +2,13 @@ module("About Asserts (topics/about_asserts.js)"); test("ok", function() { - ok(__ === true, 'what will satisfy the ok assertion?'); + ok(true === true, 'what will satisfy the ok assertion?'); }); test("not ok", function() { - ok(__ === false, 'what is a false value?'); + ok(false === false, 'what is a false value?'); }); test("equal", function() { - equal(__, 1 + 1, 'what will satisfy the equal assertion?'); + equal(2, 1 + 1, 'what will satisfy the equal assertion?'); }); From db5a48686b330abfa27ab9e626ca65fe186211f8 Mon Sep 17 00:00:00 2001 From: gbaik Date: Sat, 10 Jun 2017 21:12:54 -0700 Subject: [PATCH 2/4] Add completed about equality --- topics/about_equality.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/topics/about_equality.js b/topics/about_equality.js index fe3e3d21..17eb462c 100644 --- a/topics/about_equality.js +++ b/topics/about_equality.js @@ -2,22 +2,22 @@ module("About Equality (topics/about_equality.js)"); test("numeric equality", function() { - equal(3 + __, 7, ""); + equal(3 + 4, 7, ""); }); test("string equality", function() { - equal("3" + __, "37", "concatenate the strings"); + equal("3" + "7", "37", "concatenate the strings"); }); test("equality without type coercion", function() { - ok(3 === __, 'what is exactly equal to 3?'); + ok(3 === 3, 'what is exactly equal to 3?'); }); test("equality with type coercion", function() { - ok(3 == "__", 'what string is equal to 3, with type coercion?'); + ok(3 == "3", 'what string is equal to 3, with type coercion?'); }); test("string literals", function() { - equal(__, "frankenstein", "quote types are interchangable, but must match."); - equal(__, 'frankenstein', "quote types can use both single and double quotes."); + equal('frankenstein', "frankenstein", "quote types are interchangable, but must match."); + equal("frankenstein", 'frankenstein', "quote types can use both single and double quotes."); }); From 80916fb2af63a3bf65e4adb48ec561612efc31e7 Mon Sep 17 00:00:00 2001 From: gbaik Date: Sat, 10 Jun 2017 21:13:08 -0700 Subject: [PATCH 3/4] Add completed about operations --- topics/about_operators.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/topics/about_operators.js b/topics/about_operators.js index 9859900b..9d5ce763 100644 --- a/topics/about_operators.js +++ b/topics/about_operators.js @@ -7,7 +7,7 @@ test("addition", function() { for (var i = 0; i <= 5; i++) { result = result + i; } - equal(__, result, "What is the value of result?"); + equal(15, result, "What is the value of result?"); }); test("assignment addition", function() { @@ -16,7 +16,7 @@ test("assignment addition", function() { //the code below is just like saying result = result + i; but is more concise result += i; } - equal(__, result, "What is the value of result?"); + equal(15, result, "What is the value of result?"); }); test("subtraction", function() { @@ -24,7 +24,7 @@ test("subtraction", function() { for (var i = 0; i <= 2; i++) { result = result - i; } - equal(__, result, "What is the value of result?"); + equal(2, result, "What is the value of result?"); }); test("assignment subtraction", function() { @@ -32,7 +32,7 @@ test("assignment subtraction", function() { for (var i = 0; i <= 2; i++) { result -= i; } - equal(__, result, "What is the value of result?"); + equal(2, result, "What is the value of result?"); }); //Assignment operators are available for multiplication and division as well @@ -43,5 +43,5 @@ test("modulus", function() { var x = 5; //again this is exactly the same as result = result % x result %= x; - equal(__, result, "What is the value of result?"); + equal(0, result, "What is the value of result?"); }); From feab5fe0a7063de3210d48e601c7630dc849e63f Mon Sep 17 00:00:00 2001 From: gbaik Date: Sat, 10 Jun 2017 21:16:07 -0700 Subject: [PATCH 4/4] Add about truthyness --- topics/about_truthyness.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/topics/about_truthyness.js b/topics/about_truthyness.js index 9b524c14..1b48421d 100644 --- a/topics/about_truthyness.js +++ b/topics/about_truthyness.js @@ -3,20 +3,20 @@ module("About Truthyness (topics/about_truthyness.js)"); test("truthyness of positive numbers", function() { var oneIsTruthy = 1 ? true : false; - equal(__, oneIsTruthy, 'is one truthy?'); + equal(true, oneIsTruthy, 'is one truthy?'); }); test("truthyness of negative numbers", function() { var negativeOneIsTruthy = -1 ? true : false; - equal(__, negativeOneIsTruthy, 'is -1 truthy?'); + equal(true, negativeOneIsTruthy, 'is -1 truthy?'); }); test("truthyness of zero", function() { var zeroIsTruthy = 0 ? true : false; - equal(__, zeroIsTruthy, 'is 0 truthy?'); + equal(false, zeroIsTruthy, 'is 0 truthy?'); }); test("truthyness of null", function() { var nullIsTruthy = null ? true : false; - equal(__, nullIsTruthy, 'is null truthy?'); + equal(false, nullIsTruthy, 'is null truthy?'); });