1
0
Fork 0

Fix running server in E2E tests

This commit is contained in:
Chocobozzz 2023-10-27 10:37:18 +02:00
parent 0c63b37eb3
commit 414875a220
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -3,6 +3,8 @@ import { join, resolve } from 'path'
function runServer (appInstance: number, config: any = {}) { function runServer (appInstance: number, config: any = {}) {
const env = Object.create(process.env) const env = Object.create(process.env)
env['NODE_OPTIONS'] = ''
env['NODE_ENV'] = 'test' env['NODE_ENV'] = 'test'
env['NODE_APP_INSTANCE'] = appInstance + '' env['NODE_APP_INSTANCE'] = appInstance + ''
@ -43,7 +45,10 @@ function runServer (appInstance: number, config: any = {}) {
function runCommand (command: string) { function runCommand (command: string) {
return new Promise<void>((res, rej) => { return new Promise<void>((res, rej) => {
const p = exec(command, { cwd: getRootCWD() }) // Reset NODE_OPTIONS env set by webdriverio
const env = { ...process.env, NODE_OPTIONS: '' }
const p = exec(command, { env, cwd: getRootCWD() })
p.stderr.on('data', data => console.error(data.toString())) p.stderr.on('data', data => console.error(data.toString()))
p.on('error', err => rej(err)) p.on('error', err => rej(err))