File tree Expand file tree Collapse file tree 3 files changed +7
-18
lines changed Expand file tree Collapse file tree 3 files changed +7
-18
lines changed Original file line number Diff line number Diff line change 34
34
"mongodb-memory-server-global" : " ^7.6.3" ,
35
35
"mysql" : " ^2.18.1" ,
36
36
"nock" : " ^13.1.0" ,
37
- "pg" : " ^8.7.3" ,
38
- "portfinder" : " ^1.0.28"
37
+ "pg" : " ^8.7.3"
39
38
},
40
39
"config" : {
41
40
"mongodbMemoryServer" : {
Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ import { logger, parseSemver } from '@sentry/utils';
5
5
import axios , { AxiosRequestConfig } from 'axios' ;
6
6
import { Express } from 'express' ;
7
7
import * as http from 'http' ;
8
+ import { AddressInfo } from 'net' ;
8
9
import nock from 'nock' ;
9
10
import * as path from 'path' ;
10
- import { getPorts } from 'portfinder' ;
11
11
12
12
export type TestServerConfig = {
13
13
url : string ;
@@ -151,20 +151,9 @@ export class TestEnv {
151
151
}
152
152
} ) ;
153
153
154
- getPorts ( 50 , { } , ( err , ports ) => {
155
- if ( err ) {
156
- throw err ;
157
- }
158
-
159
- const port = ports . find (
160
- // Only allow ports that do not overlap with other workers - this is done to avoid race-conditions
161
- p => p % Number ( process . env . TEST_WORKERS_AMOUNT ) === Number ( process . env . TEST_PORT_MODULO ) ,
162
- ) ;
163
-
164
- const url = `http://localhost:${ port } /test` ;
165
- const server = app . listen ( port , ( ) => {
166
- resolve ( [ server , url ] ) ;
167
- } ) ;
154
+ const server = app . listen ( 0 , ( ) => {
155
+ const url = `http://localhost:${ ( server . address ( ) as AddressInfo ) . port } /test` ;
156
+ resolve ( [ server , url ] ) ;
168
157
} ) ;
169
158
} ) ;
170
159
Original file line number Diff line number Diff line change 34
34
},
35
35
"devDependencies" : {
36
36
"@remix-run/node" : " ^1.4.3" ,
37
- "@remix-run/react" : " ^1.4.3"
37
+ "@remix-run/react" : " ^1.4.3" ,
38
+ "portfinder" : " ^1.0.28"
38
39
},
39
40
"peerDependencies" : {
40
41
"@remix-run/node" : " 1.x" ,
You can’t perform that action at this time.
0 commit comments