From 55fff1ef2f9a28ae98a55135c4ab2b9f5f2b83fd Mon Sep 17 00:00:00 2001 From: Steve Kinney Date: Mon, 30 Sep 2024 13:25:05 -0600 Subject: [PATCH] Create game.test.js --- examples/guess-the-number/game.test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 examples/guess-the-number/game.test.js diff --git a/examples/guess-the-number/game.test.js b/examples/guess-the-number/game.test.js new file mode 100644 index 0000000..71dcc6b --- /dev/null +++ b/examples/guess-the-number/game.test.js @@ -0,0 +1,18 @@ +import { it, expect, describe, vi } from 'vitest'; +import { Game } from './game'; + +describe('Game', () => { + it('should return an instance of a game', () => { + // This is mostly a dummy test. + const game = new Game(1, 10); + expect(game).toBeInstanceOf(Game); + }); + + it('should have a secret number', () => { + // Thisn't really a useful test. + // Do I *really* care about the type of the secret number? + // Do I *really* care about the name of a "private" property? + const game = new Game(1, 10); + expect(game.secretNumber).toBeTypeOf('number'); + }); +});