summaryrefslogtreecommitdiff
path: root/fixtures.js
diff options
context:
space:
mode:
authorJulien Dessaux2023-01-03 23:51:00 +0100
committerJulien Dessaux2023-01-03 23:51:00 +0100
commitc5d2d7ca77a502ea607d2db5ecdec972bc76bc69 (patch)
tree877c4bb29aef5ba8de491d78cfc9ee7e31232ad7 /fixtures.js
parentContinue adding tests (diff)
downloadjeux-de-mots-c5d2d7ca77a502ea607d2db5ecdec972bc76bc69.tar.gz
jeux-de-mots-c5d2d7ca77a502ea607d2db5ecdec972bc76bc69.tar.bz2
jeux-de-mots-c5d2d7ca77a502ea607d2db5ecdec972bc76bc69.zip
Fixed fixtures and testing
Diffstat (limited to '')
-rw-r--r--fixtures.js25
1 files changed, 22 insertions, 3 deletions
diff --git a/fixtures.js b/fixtures.js
index bfc6b3c..f036f01 100644
--- a/fixtures.js
+++ b/fixtures.js
@@ -1,4 +1,23 @@
-import {createUser} from "./database/users.js";
+import { newGame } from './database/games.js';
+import { createUser } from './database/users.js';
+import { emptyBoard } from './utils/board.js';
-createUser("Alice", "Alice42!", "alice@example.com");
-createUser("Bob", "Bob42!", "bob@example.com");
+await createUser('Alice', 'Alice42!', 'alice@example.com');
+await createUser('Bob', 'Bob42!', 'bob@example.com');
+const data = {
+ board: emptyBoard,
+ name: 'Alice vs Bob',
+ player1: {
+ id: 1,
+ username: 'Alice',
+ score: 0,
+ letters: ['A', 'B', 'C', 'D', 'E', 'F', 'G'],
+ },
+ player2: {
+ id: 2,
+ username: 'Bob',
+ score: 0,
+ letters: ['T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
+ },
+};
+newGame(1, 2, data);