Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('Any live cell with two or three live neighbours lives on to the next generation.', function () {
- it('should save cell with two live neighbours', function () {
- game.setCell(3,2);
- game.setCell(3,4);
- game.setCell(3,3);
- game.nextFrame();
- expect(game.grid()[3][3]).toBe(1);
- });
- it('should save cell with three live neighbours', function () {
- game.setCell(3,2);
- game.setCell(3,4);
- game.setCell(4,4);
- game.setCell(3,3);
- game.nextFrame();
- expect(game.grid()[3][3]).toBe(1);
- });
- it('should save cell with three live neighbours on different rows', function () {
- game.setCell(2,2);
- game.setCell(3,4);
- game.setCell(4,4);
- game.setCell(3,3);
- game.nextFrame();
- expect(game.grid()[3][3]).toBe(1);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement