@@ -6,7 +6,6 @@ import { expect } from "chai";
6
6
import * as yaml from "js-yaml" ;
7
7
import fetch from "node-fetch" ;
8
8
import * as portfinder from "portfinder" ;
9
- import * as semver from "semver" ;
10
9
11
10
const TIMEOUT_XL = 20_000 ;
12
11
const TIMEOUT_L = 10_000 ;
@@ -124,7 +123,7 @@ async function startBin(
124
123
throw e ;
125
124
}
126
125
return true ;
127
- } , TIMEOUT_M ) ;
126
+ } , TIMEOUT_L ) ;
128
127
129
128
if ( debug ) {
130
129
proc . stdout ?. on ( "data" , ( data : unknown ) => {
@@ -139,7 +138,7 @@ async function startBin(
139
138
return {
140
139
port,
141
140
cleanup : async ( ) => {
142
- process . kill ( proc . pid ) ;
141
+ process . kill ( proc . pid , 9 ) ;
143
142
await retryUntil ( async ( ) => {
144
143
try {
145
144
process . kill ( proc . pid , 0 ) ;
@@ -148,12 +147,15 @@ async function startBin(
148
147
return Promise . resolve ( true ) ;
149
148
}
150
149
return Promise . resolve ( false ) ;
151
- } , TIMEOUT_M ) ;
150
+ } , TIMEOUT_L ) ;
152
151
} ,
153
152
} ;
154
153
}
155
154
156
- describe ( "functions.yaml" , ( ) => {
155
+ describe ( "functions.yaml" , function ( ) {
156
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
157
+ this . timeout ( TIMEOUT_XL ) ;
158
+
157
159
function runTests ( tc : Testcase ) {
158
160
let port : number ;
159
161
let cleanup : ( ) => Promise < void > ;
@@ -168,7 +170,10 @@ describe("functions.yaml", () => {
168
170
await cleanup ?.( ) ;
169
171
} ) ;
170
172
171
- it ( "functions.yaml returns expected Manifest" , async ( ) => {
173
+ it ( "functions.yaml returns expected Manifest" , async function ( ) {
174
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
175
+ this . timeout ( TIMEOUT_M ) ;
176
+
172
177
const res = await fetch ( `http://localhost:${ port } /__/functions.yaml` ) ;
173
178
const text = await res . text ( ) ;
174
179
let parsed : any ;
@@ -181,7 +186,10 @@ describe("functions.yaml", () => {
181
186
} ) ;
182
187
}
183
188
184
- describe ( "commonjs" , ( ) => {
189
+ describe ( "commonjs" , function ( ) {
190
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
191
+ this . timeout ( TIMEOUT_L ) ;
192
+
185
193
const testcases : Testcase [ ] = [
186
194
{
187
195
name : "basic" ,
@@ -250,34 +258,35 @@ describe("functions.yaml", () => {
250
258
runTests ( tc ) ;
251
259
} ) ;
252
260
}
253
- } ) . timeout ( TIMEOUT_L ) ;
261
+ } ) ;
254
262
255
- if ( semver . gt ( process . versions . node , "13.2.0" ) ) {
256
- describe ( "esm" , ( ) => {
257
- const testcases : Testcase [ ] = [
258
- {
259
- name : "basic" ,
260
- modulePath : "./scripts/bin-test/sources/esm" ,
261
- expected : BASE_STACK ,
262
- } ,
263
- {
264
- name : "with main" ,
263
+ describe ( "esm" , function ( ) {
264
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
265
+ this . timeout ( TIMEOUT_L ) ;
265
266
266
- modulePath : "./scripts/bin-test/sources/esm-main" ,
267
- expected : BASE_STACK ,
268
- } ,
269
- {
270
- name : "with .m extension" ,
271
- modulePath : "./scripts/bin-test/sources/esm-ext" ,
272
- expected : BASE_STACK ,
273
- } ,
274
- ] ;
267
+ const testcases : Testcase [ ] = [
268
+ {
269
+ name : "basic" ,
270
+ modulePath : "./scripts/bin-test/sources/esm" ,
271
+ expected : BASE_STACK ,
272
+ } ,
273
+ {
274
+ name : "with main" ,
275
275
276
- for ( const tc of testcases ) {
277
- describe ( tc . name , ( ) => {
278
- runTests ( tc ) ;
279
- } ) ;
280
- }
281
- } ) . timeout ( TIMEOUT_L ) ;
282
- }
283
- } ) . timeout ( TIMEOUT_XL ) ;
276
+ modulePath : "./scripts/bin-test/sources/esm-main" ,
277
+ expected : BASE_STACK ,
278
+ } ,
279
+ {
280
+ name : "with .m extension" ,
281
+ modulePath : "./scripts/bin-test/sources/esm-ext" ,
282
+ expected : BASE_STACK ,
283
+ } ,
284
+ ] ;
285
+
286
+ for ( const tc of testcases ) {
287
+ describe ( tc . name , ( ) => {
288
+ runTests ( tc ) ;
289
+ } ) ;
290
+ }
291
+ } ) ;
292
+ } ) ;
0 commit comments