From 2f3eaed6a0855f101f615df7664b3aeccfc916da Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 9 Jan 2017 20:42:28 +0000 Subject: [PATCH] Fix tests --- server.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 04f11cc..e0e3d4c 100644 --- a/server.js +++ b/server.js @@ -7,7 +7,12 @@ const winston = require('winston'); const expressWinston = require('express-winston'); const PORT = process.env.PORT || 5000; -const SERVE_DIR = process.argv[process.argv.length - 1] || 'site/' +let SERVE_DIR; +if (process.env.NODE_ENV === 'test') { + SERVE_DIR = 'site'; +} else { + SERVE_DIR = process.argv[process.argv.length - 1]; +} const PAGE_404 = path.join(SERVE_DIR, '.404.html'); const app = express();