Add lab 9 content
This commit is contained in:
11
labs/L09/spec/builtins.spec.js
Normal file
11
labs/L09/spec/builtins.spec.js
Normal file
@ -0,0 +1,11 @@
|
||||
describe("identity",
|
||||
function() {
|
||||
it("1 === 1", function() { expect(1).toBe(1); });
|
||||
it("null === null", function() { expect(null).toBe(null); })
|
||||
});
|
||||
|
||||
describe("arithmetic",
|
||||
function() {
|
||||
it("1 + 1 === 2", function() { expect(1 + 1).toBe(2); });
|
||||
it("6 * 7 === 42", function() { expect(6*7).toBe(42); });
|
||||
});
|
30
labs/L09/spec/loop-arith.spec.js
Normal file
30
labs/L09/spec/loop-arith.spec.js
Normal file
@ -0,0 +1,30 @@
|
||||
let arith=require ("../loop-arith.js");
|
||||
|
||||
describe("add",
|
||||
function() {
|
||||
it("1 + 1 = 2",
|
||||
function() {
|
||||
expect(arith.add(1, 1)).toBe(2);
|
||||
});
|
||||
it("0 + x = x",
|
||||
function() {
|
||||
expect(arith.add(0, 1)).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("mult",
|
||||
function() {
|
||||
it("0 * 2 = 0",
|
||||
function() {
|
||||
expect(arith.mult(0, 2)).toBe(0);
|
||||
});
|
||||
|
||||
it("1 * 2 = 2",
|
||||
function() {
|
||||
expect(arith.mult(1,2)).toBe(2);
|
||||
});
|
||||
it("2 * 2 = 4",
|
||||
function() {
|
||||
expect(arith.mult(2, 2)).toBe(4)
|
||||
});
|
||||
});
|
13
labs/L09/spec/support/jasmine.json
Normal file
13
labs/L09/spec/support/jasmine.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"spec_dir": "spec",
|
||||
"spec_files": [
|
||||
"**/*[sS]pec.?(m)js"
|
||||
],
|
||||
"helpers": [
|
||||
"helpers/**/*.?(m)js"
|
||||
],
|
||||
"env": {
|
||||
"stopSpecOnExpectationFailure": false,
|
||||
"random": true
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user