Skip to content

Commit c3aac06

Browse files
committed
chore: enable debugging during tests
1 parent eb9f291 commit c3aac06

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"release": "release-it",
3131
"version": "npm run build",
3232
"prepublishOnly": "npm run build",
33-
"quick:test": "node --enable-source-maps --import=@poppinss/ts-exec bin/test.ts"
33+
"quick:test": "cross-env NODE_DEBUG=adonisjs:assembler node --enable-source-maps --import=@poppinss/ts-exec bin/test.ts"
3434
},
3535
"devDependencies": {
3636
"@adonisjs/eslint-config": "^3.0.0-next.0",
@@ -46,6 +46,7 @@
4646
"@types/picomatch": "^4.0.0",
4747
"@types/pretty-hrtime": "^1.0.3",
4848
"c8": "^10.1.3",
49+
"cross-env": "^7.0.3",
4950
"del-cli": "^6.0.0",
5051
"eslint": "^9.28.0",
5152
"hot-hook": "^0.4.1-next.0",

src/dev_server.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,15 @@ export class DevServer {
222222
* file is being imported.
223223
*/
224224
if ((action === 'add' || action === 'delete') && this.mode === 'hmr') {
225+
debug('ignoring add and delete actions in HMR mode %s', filePath)
225226
return
226227
}
227228

228229
/**
229230
* Notify about the invalidated file
230231
*/
231232
if (info && info.source === 'hot-hook' && info.hotReloaded) {
233+
debug('hot reloading %s, info %O', filePath, info)
232234
this.ui.logger.log(`${this.ui.colors.green('invalidated')} ${filePath}`)
233235
return
234236
}
@@ -237,6 +239,7 @@ export class DevServer {
237239
* Do not do anything when fullReload is not enabled.
238240
*/
239241
if (info && !info.fullReload) {
242+
debug('ignoring full reload', filePath, info)
240243
return
241244
}
242245

@@ -292,9 +295,13 @@ export class DevServer {
292295

293296
this.#httpServer.on('message', async (message) => {
294297
if (this.#isAdonisJSReadyMessage(message)) {
298+
debug('received http server ready message %O', message)
299+
295300
await this.#postServerReady(message)
296301
resolve()
297302
} else if (this.#mode === 'hmr' && this.#isHotHookMessage(message)) {
303+
debug('received hot-hook message %O', message)
304+
298305
if (message.type === 'hot-hook:file-changed') {
299306
switch (message.action) {
300307
case 'add':

0 commit comments

Comments
 (0)