22 lines
1.2 KiB
JavaScript
22 lines
1.2 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var mancala_1 = require("../src/mancala");
|
|
describe('mancala', function () {
|
|
var player1 = "0";
|
|
var player2 = "0";
|
|
it('turn test', function () {
|
|
var game = mancala_1.createGame(player1, player2);
|
|
game.turn = "player1";
|
|
game.moveByIndex(3, "player1");
|
|
expect(game.turn).toBe("player1");
|
|
});
|
|
it('zero hole test 1', function () {
|
|
var board = new mancala_1.Board([new mancala_1.Hole(0), new mancala_1.Hole(1), new mancala_1.Hole(2), new mancala_1.Hole(3), new mancala_1.Hole(4), new mancala_1.Hole(5)], [new mancala_1.Hole(1), new mancala_1.Hole(0), new mancala_1.Hole(4), new mancala_1.Hole(4), new mancala_1.Hole(4), new mancala_1.Hole(4)], new mancala_1.Store(0), new mancala_1.Store(0));
|
|
var game = new mancala_1.Game(player1, player2, board, "player2");
|
|
game.moveByIndex(0, "player2");
|
|
expect(game.turn).toBe("player1");
|
|
expect(game.board.player2Store.ballCount).toBe(5);
|
|
expect(game.board.player1Holes[game.board.player1Holes.length - 1 - 1].ballCount).toBe(0);
|
|
});
|
|
});
|
|
//# sourceMappingURL=mancala.test.js.map
|