mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-06-28 21:05:36 -04:00
feat: add player methods
This commit is contained in:
parent
904c4901da
commit
718fdf63b1
4 changed files with 34 additions and 1 deletions
18
battleship/tests/player.test.js
Normal file
18
battleship/tests/player.test.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Gameboard } from '../src/components/gameboard';
|
||||
class Player {
|
||||
constructor(name) {
|
||||
this.gameboard = new Gameboard();
|
||||
this.playerName = name;
|
||||
}
|
||||
}
|
||||
|
||||
let p = new Player('Player1');
|
||||
|
||||
it('should contain a gameboard', () => {
|
||||
expect(p.gameboard).toHaveProperty(
|
||||
'ships',
|
||||
'scoreboard',
|
||||
'shipCount',
|
||||
'sunkShipCount',
|
||||
);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue