@@ -6,7 +6,6 @@ import { expect } from "chai";
66import * as yaml from "js-yaml" ;
77import fetch from "node-fetch" ;
88import * as portfinder from "portfinder" ;
9- import * as semver from "semver" ;
109
1110const TIMEOUT_XL = 20_000 ;
1211const TIMEOUT_L = 10_000 ;
@@ -124,7 +123,7 @@ async function startBin(
124123 throw e ;
125124 }
126125 return true ;
127- } , TIMEOUT_M ) ;
126+ } , TIMEOUT_L ) ;
128127
129128 if ( debug ) {
130129 proc . stdout ?. on ( "data" , ( data : unknown ) => {
@@ -139,7 +138,7 @@ async function startBin(
139138 return {
140139 port,
141140 cleanup : async ( ) => {
142- process . kill ( proc . pid ) ;
141+ process . kill ( proc . pid , 9 ) ;
143142 await retryUntil ( async ( ) => {
144143 try {
145144 process . kill ( proc . pid , 0 ) ;
@@ -148,12 +147,15 @@ async function startBin(
148147 return Promise . resolve ( true ) ;
149148 }
150149 return Promise . resolve ( false ) ;
151- } , TIMEOUT_M ) ;
150+ } , TIMEOUT_L ) ;
152151 } ,
153152 } ;
154153}
155154
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+
157159 function runTests ( tc : Testcase ) {
158160 let port : number ;
159161 let cleanup : ( ) => Promise < void > ;
@@ -168,7 +170,10 @@ describe("functions.yaml", () => {
168170 await cleanup ?.( ) ;
169171 } ) ;
170172
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+
172177 const res = await fetch ( `http://localhost:${ port } /__/functions.yaml` ) ;
173178 const text = await res . text ( ) ;
174179 let parsed : any ;
@@ -181,7 +186,10 @@ describe("functions.yaml", () => {
181186 } ) ;
182187 }
183188
184- describe ( "commonjs" , ( ) => {
189+ describe ( "commonjs" , function ( ) {
190+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
191+ this . timeout ( TIMEOUT_L ) ;
192+
185193 const testcases : Testcase [ ] = [
186194 {
187195 name : "basic" ,
@@ -250,34 +258,35 @@ describe("functions.yaml", () => {
250258 runTests ( tc ) ;
251259 } ) ;
252260 }
253- } ) . timeout ( TIMEOUT_L ) ;
261+ } ) ;
254262
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 ) ;
265266
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" ,
275275
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