Update lab 9 content
This commit is contained in:
17
labs/L09/spec/ancestry.spec.js
Normal file
17
labs/L09/spec/ancestry.spec.js
Normal file
@ -0,0 +1,17 @@
|
||||
let by_name=require("../ancestry.js").by_name;
|
||||
describe("by_name", function() {
|
||||
it("not-present", function() {
|
||||
expect(by_name("ronald mcdonald")).toBe(null);
|
||||
expect(by_name("Captain Ahab")).toBe(null);
|
||||
});
|
||||
it("first", function () {
|
||||
expect(by_name("Carolus Haverbeke")).toEqual({"name": "Carolus Haverbeke", "sex": "m", "born": 1832, "died": 1905, "father": "Carel Haverbeke", "mother": "Maria van Brussel"});
|
||||
});
|
||||
it("last", function () {
|
||||
expect(by_name("Jacobus Bernardus van Brussel")).toEqual({"name": "Jacobus Bernardus van Brussel", "sex": "m", "born": 1736, "died": 1809, "father": "Jan van Brussel", "mother": "Elisabeth Haverbeke"});
|
||||
});
|
||||
it("middle", function () {
|
||||
expect(by_name("Joanna de Pape")).toEqual( {"name": "Joanna de Pape", "sex": "f", "born": 1654, "died": 1723, "father": "Vincent de Pape", "mother": "Petronella Wauters"});
|
||||
});
|
||||
|
||||
});
|
@ -1,6 +1,6 @@
|
||||
let arith=require ("../loop-arith.js");
|
||||
|
||||
describe("add",
|
||||
describe("plus",
|
||||
function() {
|
||||
it("1 + 1 = 2",
|
||||
function() {
|
||||
@ -25,6 +25,19 @@ describe("mult",
|
||||
});
|
||||
it("2 * 2 = 4",
|
||||
function() {
|
||||
expect(arith.mult(2, 2)).toBe(4)
|
||||
expect(arith.mult(2, 2)).toBe(4);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("minus",
|
||||
function() {
|
||||
it("1 - 1 = 0",
|
||||
function() {
|
||||
expect(arith.minus(1, 1)).toBe(0);
|
||||
});
|
||||
|
||||
it("0 - x = -x",
|
||||
function() {
|
||||
expect(arith.minus(0, 1)).toBe(-1);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user