File tree 1 file changed +8
-6
lines changed
packages/remix/test/integration/test/server/utils 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
import express from 'express' ;
2
2
import { createRequestHandler } from '@remix-run/express' ;
3
- import { getPortPromise } from 'portfinder' ;
3
+ import { getPort , getPortPromise } from 'portfinder' ;
4
4
import { wrapExpressCreateRequestHandler } from '@sentry/remix' ;
5
5
import { TestEnv } from '../../../../../../node-integration-tests/utils' ;
6
6
import * as http from 'http' ;
@@ -16,18 +16,20 @@ export class RemixTestEnv extends TestEnv {
16
16
const requestHandlerFactory =
17
17
adapter === 'express' ? wrapExpressCreateRequestHandler ( createRequestHandler ) : createRequestHandler ;
18
18
19
- const port = await getPortPromise ( ) ;
20
-
19
+ let serverPort ;
21
20
const server = await new Promise < http . Server > ( resolve => {
22
21
const app = express ( ) ;
23
22
24
23
app . all ( '*' , requestHandlerFactory ( { build : require ( '../../../build' ) } ) ) ;
25
24
26
- const server = app . listen ( port , ( ) => {
27
- resolve ( server ) ;
25
+ getPort ( ( _ , port ) => {
26
+ serverPort = port ;
27
+ const server = app . listen ( port , ( ) => {
28
+ resolve ( server ) ;
29
+ } ) ;
28
30
} ) ;
29
31
} ) ;
30
32
31
- return new RemixTestEnv ( server , `http://localhost:${ port } ` ) ;
33
+ return new RemixTestEnv ( server , `http://localhost:${ serverPort } ` ) ;
32
34
}
33
35
}
You can’t perform that action at this time.
0 commit comments