From 3acf783d948ebb1907da875ef87b0da9ef2309ff Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 1 Jan 2023 23:23:57 +0100 Subject: Began adding tests --- main.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'main.js') diff --git a/main.js b/main.js index c3ab576..391a4fe 100644 --- a/main.js +++ b/main.js @@ -15,5 +15,9 @@ app.use("/games", gamesRouter); app.use("/static", express.static("static")); app.use("/", rootRouter); -const port = process.env.PORT || 3000; -app.listen(port, () => console.log(`listening on port ${port}`)); +if (process.env.NODE_ENV !== "test") { + const port = process.env.PORT || 3000; + app.listen(port, () => console.log(`listening on port ${port}`)); +} + +export default app; -- cgit v1.2.3