@@ -129,48 +129,6 @@ test.group('Register', () => {
129129 await supertest ( 'http://localhost:3333' ) . get ( '/' ) . expect ( 200 ) . expect ( 'Hello World! Updated new' )
130130 } )
131131
132- test ( 'use package.json dirname as root directory' , async ( { fs } ) => {
133- await fakeInstall ( fs . basePath )
134-
135- await fs . createJson ( 'package.json' , {
136- type : 'module' ,
137- hotHook : { boundaries : [ './src/app.js' ] } ,
138- } )
139- await fs . create (
140- 'bin/server.js' ,
141- `import * as http from 'http'
142- import { join } from 'node:path'
143-
144- const server = http.createServer(async (request, response) => {
145- const app = await import('../src/app.js')
146- await app.default(request, response)
147- })
148-
149- server.listen(3333, () => console.log('Server is running'))
150- ` ,
151- )
152-
153- await createHandlerFile ( { path : 'src/app.js' , response : 'Hello World!' } )
154-
155- const server = runProcess ( 'bin/server.js' , {
156- cwd : fs . basePath ,
157- env : { NODE_DEBUG : 'hot-hook' } ,
158- nodeOptions : [ '--import=hot-hook/register' ] ,
159- } )
160-
161- await server . waitForOutput ( 'Server is running' )
162-
163- await supertest ( 'http://localhost:3333' ) . get ( '/' ) . expect ( 200 ) . expect ( 'Hello World!' )
164-
165- await setTimeout ( 100 )
166- await createHandlerFile ( { path : 'src/app.js' , response : 'Hello World! Updated' } )
167- await supertest ( 'http://localhost:3333' ) . get ( '/' ) . expect ( 200 ) . expect ( 'Hello World! Updated' )
168-
169- await setTimeout ( 100 )
170- await createHandlerFile ( { path : 'src/app.js' , response : 'Hello World! Updated new' } )
171- await supertest ( 'http://localhost:3333' ) . get ( '/' ) . expect ( 200 ) . expect ( 'Hello World! Updated new' )
172- } )
173-
174132 test ( 'use package.json restart files' , async ( { fs } ) => {
175133 await fakeInstall ( fs . basePath )
176134
@@ -271,7 +229,7 @@ test.group('Register', () => {
271229 await app.default(request, response)
272230 })
273231
274- server.listen(3333, () => console.log('Server is running'))`
232+ server.listen(3333, () => console.log('Server is running'))` ,
275233 )
276234
277235 await createHandlerFile ( { path : 'app.js' , response : 'Hello World!' } )
@@ -318,7 +276,7 @@ test.group('Register', () => {
318276 server . child ,
319277 'message' ,
320278 ( message : any ) =>
321- message ?. type === 'hot-hook:file-changed' && message . path === join ( fs . basePath , 'app.js' )
279+ message ?. type === 'hot-hook:file-changed' && message . path === join ( fs . basePath , 'app.js' ) ,
322280 )
323281
324282 assert . isDefined ( result )
@@ -373,7 +331,7 @@ test.group('Register', () => {
373331 ( message : any ) =>
374332 message ?. type === 'hot-hook:file-changed' &&
375333 message . path === join ( fs . basePath , 'app2.js' ) &&
376- message . action === 'add'
334+ message . action === 'add' ,
377335 )
378336
379337 assert . isDefined ( result )
0 commit comments