Skip to content

AssertionError when debugging in VS Code #2946

@Basssiiie

Description

@Basssiiie

Hey I've been using the VS Code debugger launch configuration from here for quite a while now, but since updating to V4 I cannot get it to work anymore. Whenever I run it, I run into this error on any of the test files:

  Uncaught exception in tests\temp.tests.ts

  AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

    assert(refs.runnerChain)


  × tests\temp.tests.ts exited with a non-zero exit code: 1
  ─

  1 uncaught exception

The example test file used (the error occurs on any test file though):

import test from "ava";

test("ava test", t =>
{
	t.pass();
});

The VS Code launch.json (exact copy from the linked docs):

{
	"version": "0.2.0",
	"configurations": [
		{
			"type": "node",
			"request": "launch",
			"name": "Debug AVA test file",
			"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ava",
			"runtimeArgs": [
				"${file}"
			],
			"outputCapture": "std",
			"skipFiles": [
				"<node_internals>/**/*.js"
			]
		}
	]
}

AVA configuration in package.json:

	"ava": {
		"extensions": [
			"ts"
		],
		"files": [
			"tests/**/*.tests.ts"
		],
		"require": [
			"./tests/_setup.js",
			"ts-node/register"
		],
		"verbose": true
	}

Running npx ava --version reports 0.1.0? I have 4.0.1 installed according to the package.json and the node_modules/ava folder and both npm install and npm update do not change that.

AVA debugging still works in another project running 3.15

This sounds like a bug right?

Thank you for your time!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions