Update lab 12 skeleton

This commit is contained in:
Isaac Shoebottom
2022-10-25 11:15:01 -03:00
parent 243b14b247
commit 8f668a032f
3 changed files with 77 additions and 1 deletions

View File

@ -0,0 +1,28 @@
let village = require("../village.js");
let VillageState = village.VillageState;
describe("roadGraph",
function () {
let roadGraph = village.roadGraph;
it("Alice's house",
() => expect(roadGraph["Alice's House"]).toEqual(["Bob's House", "Cabin", "Post Office"]));
it("Bob's house",
() => expect(roadGraph["Bob's House"]).toEqual(
jasmine.objectContaining(["Alice's House"])));
});
describe("VillageState",
function () {
let first = new VillageState(
"Post Office",
[{ place: "Post Office", address: "Alice's House" }]
);
let next = first.move("Alice's House");
it("next place",
() => expect(next.place).toBe("Alice's House"));
it("next parcels",
() => expect(next.parcels).toEqual([]));
it("first place",
() => expect(first.place).toEqual("Post Office"));
}
);