Skip to content

Instantly share code, notes, and snippets.

@phudekar
Created October 12, 2020 10:21
Show Gist options
  • Save phudekar/d18d5a3af2c2310870ebec19be222c8b to your computer and use it in GitHub Desktop.
Save phudekar/d18d5a3af2c2310870ebec19be222c8b to your computer and use it in GitHub Desktop.
testing spa - unit test
it('should explode if it has mine', () => {
const mine = true;
const block = new Block(new Position(1, 1), mine);
const { mineExploded } = block.reveal([]);
expect(mineExploded).toBeTruthy();
})
it('should not explode if it does not have mine', () => {
const block = new Block(new Position(1, 1));
const { mineExploded } = block.reveal([]);
expect(mineExploded).toBeFalsy();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment