From 60de58a4ea96f1effa46dd4e4570420b362aeaf1 Mon Sep 17 00:00:00 2001 From: AlexxNB Date: Thu, 3 Feb 2022 22:29:46 +0300 Subject: [PATCH] test: Changing test environment --- tests/environment.js | 5 +++-- tests/server.js | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 tests/server.js diff --git a/tests/environment.js b/tests/environment.js index 1fb258c..3e4a2f8 100644 --- a/tests/environment.js +++ b/tests/environment.js @@ -6,8 +6,9 @@ async function setup(context) { console.log('Launching test server...'); if(!(await ports.check(5050))) throw new Error("Port 5050 already in use, can't launch test server.") - context.srv = spawn('derver', ['--no-watch','--spa','--port=5050','tests/www'],{ - detached: false + context.srv = spawn('node',['server.js'],{ + detached: false, + cwd: 'tests' }); process.on("exit", () => context.srv.kill()); await ports.wait(5050); diff --git a/tests/server.js b/tests/server.js new file mode 100644 index 0000000..6a15d62 --- /dev/null +++ b/tests/server.js @@ -0,0 +1,8 @@ +const {derver} = require('derver'); + +derver({ + dir: 'www', + port: 5050, + spa: true, + watch: false, +}); \ No newline at end of file