Ava: Debugging multiple files with AVA

Created on 20 Oct 2019  路  3Comments  路  Source: avajs/ava

Description

Currently, ava only support debugging one file a time only:

https://github.com/avajs/ava/blob/20f86d683cb10b43d88681a1904ad2c57c0a856b/profile.js#L70-L75

When i debug some file, i have to navigate to that file before running VSCode debugger, which is inconvenient when i keep breakpoint in another file or when i want to debug all test files at once.

Config

Here is my current VSCode debugger configuration and my expected one:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Run AVA test",
      "program": "${workspaceFolder}/node_modules/ava/profile.js",
-     "args": ["${file}", "--serial"],
+     "args": ["./**/*ts", "--serial"],
+     "cwd": "${workspaceFolder}",
      "skipFiles": ["<node_internals>/**/*.js"]
    }
  ]
}

Relevant Links

Here is the link to my current project.

Environment

| Name | Version |
|-------|---------|
| Node.js | 12.10.0 |
| win32 | 10.0.18362 |
| ava | 2.3.0 |
| npm | 6.10.3 |

question

All 3 comments

Could you elaborate on what improvement you're suggesting?

@novemberborn Thanks for your quick reply. What i means is currently, i can inspect one file a time:

$ inspect node_modules/ava/profile.js ./test/file.js

Is it possible to inspect multiple files at once?

$ inspect node_modules/ava/profile.js ./test/**/*.js

Ah I see. profile.js fakes a regular worker process so that won't work with multiple files.

There's a few other approaches discussed here: https://github.com/avajs/ava/issues/1505. Setting breakpoints in multiple test files won't ever be graceful though I think. I imagine you're better off debugging tests one at a time.

(I'm closing this issue for housekeeping purposes, but let's keep the conversation going.)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sindresorhus picture sindresorhus  路  3Comments

OmgImAlexis picture OmgImAlexis  路  3Comments

niftylettuce picture niftylettuce  路  4Comments

electerious picture electerious  路  3Comments

fleg picture fleg  路  3Comments