We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d43d239 commit 64971eeCopy full SHA for 64971ee
2 files changed
src/core/game.js
@@ -67,6 +67,10 @@ export function Game(game) {
67
if (game.playerView === undefined) game.playerView = G => G;
68
if (game.plugins === undefined) game.plugins = [];
69
70
+ if (game.name.includes(' ')) {
71
+ throw new Error(game.name + ': Game name must not include spaces');
72
+ }
73
+
74
const flow = Flow(game);
75
76
return {
src/core/game.test.js
@@ -211,3 +211,10 @@ test('serpentine setup phases', () => {
211
expect(client.getState().ctx.currentPlayer).toBe('1');
212
expect(client.getState().ctx.phase).toBe('main phase');
213
});
214
215
+test('game name with spaces should raise Error', () => {
216
+ const game = () => {
217
+ Game({ name: 'tic tac toe' });
218
+ };
219
+ expect(game).toThrow();
220
+});
0 commit comments