diff options
Diffstat (limited to 'server/tests/utils/servers.ts')
-rw-r--r-- | server/tests/utils/servers.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/tests/utils/servers.ts b/server/tests/utils/servers.ts index 272a8935e..88027f74e 100644 --- a/server/tests/utils/servers.ts +++ b/server/tests/utils/servers.ts | |||
@@ -5,6 +5,7 @@ interface ServerInfo { | |||
5 | app: ChildProcess, | 5 | app: ChildProcess, |
6 | url: string | 6 | url: string |
7 | host: string | 7 | host: string |
8 | serverNumber: number | ||
8 | 9 | ||
9 | client: { | 10 | client: { |
10 | id: string, | 11 | id: string, |
@@ -65,9 +66,10 @@ function flushTests () { | |||
65 | }) | 66 | }) |
66 | } | 67 | } |
67 | 68 | ||
68 | function runServer (serverNumber: number) { | 69 | function runServer (serverNumber: number, configOverride?: Object) { |
69 | const server: ServerInfo = { | 70 | const server: ServerInfo = { |
70 | app: null, | 71 | app: null, |
72 | serverNumber: serverNumber, | ||
71 | url: `http://localhost:${9000 + serverNumber}`, | 73 | url: `http://localhost:${9000 + serverNumber}`, |
72 | host: `localhost:${9000 + serverNumber}`, | 74 | host: `localhost:${9000 + serverNumber}`, |
73 | client: { | 75 | client: { |
@@ -98,6 +100,11 @@ function runServer (serverNumber: number) { | |||
98 | const env = Object.create(process.env) | 100 | const env = Object.create(process.env) |
99 | env['NODE_ENV'] = 'test' | 101 | env['NODE_ENV'] = 'test' |
100 | env['NODE_APP_INSTANCE'] = serverNumber.toString() | 102 | env['NODE_APP_INSTANCE'] = serverNumber.toString() |
103 | |||
104 | if (configOverride !== undefined) { | ||
105 | env['NODE_CONFIG'] = JSON.stringify(configOverride) | ||
106 | } | ||
107 | |||
101 | const options = { | 108 | const options = { |
102 | silent: true, | 109 | silent: true, |
103 | env: env, | 110 | env: env, |