Skip to content

Debugging multiple files with AVA #2274

Closed
@clitetailor

Description

@clitetailor

Description

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

ava/profile.js

Lines 70 to 75 in 20f86d6

if (cli.input.length === 0) {
throw new Error('Specify a test file');
}
const file = path.resolve(cli.input[0]);
const cacheDir = conf.cacheEnabled === false ? uniqueTempDir() : path.join(projectDir, 'node_modules', '.cache', 'ava');

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions