@@ -5,11 +5,11 @@ import {readFile, copyFile, rm} from "node:fs/promises";
55import { join } from "node:path" ;
66
77const testDir = mkdtempSync ( join ( tmpdir ( ) , "daemonize-process-" ) ) ;
8- const sleep = ms => new Promise ( resolve => setTimeout ( resolve , ms ) ) ;
8+ const sleep = ( ms : number ) => new Promise ( resolve => setTimeout ( resolve , ms ) ) ;
99
1010beforeAll ( async ( ) => {
11- await copyFile ( new URL ( "index.js " , import . meta. url ) , join ( testDir , "index.js " ) ) ;
12- await copyFile ( new URL ( "child.js " , import . meta. url ) , join ( testDir , "child.js " ) ) ;
11+ await copyFile ( new URL ( "index.ts " , import . meta. url ) , join ( testDir , "index.ts " ) ) ;
12+ await copyFile ( new URL ( "child.ts " , import . meta. url ) , join ( testDir , "child.ts " ) ) ;
1313 await copyFile ( new URL ( "package.json" , import . meta. url ) , join ( testDir , "package.json" ) ) ;
1414} ) ;
1515
@@ -19,7 +19,7 @@ afterAll(async () => {
1919
2020test ( "simple" , ( ) => {
2121 return new Promise ( resolve => {
22- const child = fork ( join ( testDir , "child.js " ) ) ;
22+ const child = fork ( join ( testDir , "child.ts " ) ) ;
2323
2424 child . on ( "exit" , async ( ) => {
2525 await sleep ( 1000 ) ; // give the child some time to exit
@@ -35,7 +35,7 @@ test("simple", () => {
3535
3636 // verify that internal tracking variable is not leaked to the child
3737 expect ( envVar ) . toEqual ( "false" ) ;
38- resolve ( ) ;
38+ resolve ( undefined ) ;
3939 } ) ;
4040 } ) ;
4141} ) ;
0 commit comments