Add lab 9 content

This commit is contained in:
Isaac Shoebottom
2022-10-12 09:04:35 -03:00
parent 585fb2e9e8
commit 76d1fb6c53
7 changed files with 92 additions and 1 deletions

View 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); });
});

View 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)
});
});

View File

@ -0,0 +1,13 @@
{
"spec_dir": "spec",
"spec_files": [
"**/*[sS]pec.?(m)js"
],
"helpers": [
"helpers/**/*.?(m)js"
],
"env": {
"stopSpecOnExpectationFailure": false,
"random": true
}
}