-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathsolution.js
More file actions
42 lines (31 loc) · 1.12 KB
/
solution.js
File metadata and controls
42 lines (31 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const chai = require('chai');
const Pacman = require('../pacman');
const Biscuit = require('../biscuit');
const Phantom = require('../phantom');
const Pellet = require('../pellet');
describe("pacman", () => {
it("should get fat whether it eats biscuits", () => {
var pacman = new Pacman();
pacman.eats(new Biscuit());
chai.assert.equal(pacman.weight(), 1);
});
it("should get fat whether it eats several biscuits", () => {
var pacman = new Pacman();
pacman.eats(new Biscuit());
pacman.eats(new Biscuit());
chai.assert.equal(pacman.weight(), 2);
});
it("should die whether bumps into phanton", () => {
var pacman = new Pacman();
pacman.bumpsInto(new Phantom());
chai.assert.equal(pacman.isAlive(), false);
chai.assert.equal(pacman.isDead(), true);
});
it.skip("should weaken phantom whether it eats a pellet", () => {
var pacman = new Pacman();
var phantom = new Phantom();
pacman.eats(new Pellet());
pacman.bumpsInto(phantom);
chai.assert.equal(pacman.isAlive(), true);
});
});