summaryrefslogtreecommitdiff
path: root/database/db.js
diff options
context:
space:
mode:
authorJulien Dessaux2023-01-01 23:23:57 +0100
committerJulien Dessaux2023-01-02 20:26:28 +0100
commit3acf783d948ebb1907da875ef87b0da9ef2309ff (patch)
tree06b805fab10e638a9f5e66714ef4a29b6409c1e7 /database/db.js
parentRefactored game creation (diff)
downloadjeux-de-mots-3acf783d948ebb1907da875ef87b0da9ef2309ff.tar.gz
jeux-de-mots-3acf783d948ebb1907da875ef87b0da9ef2309ff.tar.bz2
jeux-de-mots-3acf783d948ebb1907da875ef87b0da9ef2309ff.zip
Began adding tests
Diffstat (limited to 'database/db.js')
-rw-r--r--database/db.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/database/db.js b/database/db.js
index a360e9b..1e8b50d 100644
--- a/database/db.js
+++ b/database/db.js
@@ -6,7 +6,10 @@ const allMigrations = [
"database/001_games.sql",
];
-const db = new Database("jdm.db");
+const db = new Database(
+ process.env.NODE_ENV === "test" ? "testjdm.db" : "jdm.db",
+ process.env.NODE_ENV === "development" ? { verbose: console.log } : null
+);
db.pragma("foreign_keys = ON");
db.transaction(function migrate() {