ava: vscode debug + typescript recipes are incompatible as authored
Please provide details about:
What you’re trying to do
debug tests, in typescript, ts-node only
What happened
Test executed successfully, but both breakpoints & debugger statements ignored

What you expected to happen
debugger statements to halt execution
- per using-ts-node, some TS configuration is needed in package.json. i’ve added:
"ava": {
"extensions": [
"ts"
],
"require": [
"ts-node/register/transpile-only"
],
"files": [
"test/**/*.test.ts"
]
}
- per creating-a-launch-configuration, various launch configuration is required:
{
"type": "node",
"request": "launch",
"name": "Debug AVA test file",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ava",
"runtimeArgs": ["${file}"],
"outputCapture": "std"
// "skipFiles": ["<node_internals>/**/*.js"] // i've disabled simply to remove more variables
}
Interestingly, I can get into a breakpoint if I execute a alternate debugging workflow:
npx ava debug test/class.test.tsAttacha debugger
Works fine 😃
Previously, ava entered a debug session via more idiomatic node debug conventions–node --inspect <path/to/ava/profile.js> <test name>. It seems like now ava is doing some fancy footwork, where it wants to start the node debugger, where VSCode also wants to start the debugger, and consequently these two things may be trampling each other a bit.
I don’t have a minimal repro, but it’s a pretty straightforward repro:
git clone https://github.com/cdaringe/factorio-tsgit checkout 7cbc8e9yarn- execute the VSCode launch as recorded above
- observe.
We’ll also need your AVA configuration (in
package.jsonorava.config.*configuration files) and how you’re invoking AVA. Share the installed AVA version (get it by runningnpx ava --version).
Shared above, but here’s also envinfo output:
System:
OS: macOS 11.1
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 637.21 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 15.0.1 - ~/.fnm/current/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.0.3 - ~/.fnm/current/bin/npm
Managers:
Cargo: 1.42.0 - ~/.cargo/bin/cargo
Homebrew: 2.6.2 - /usr/local/bin/brew
pip2: 19.3.1 - /usr/local/bin/pip2
pip3: 20.3.1 - /usr/local/bin/pip3
RubyGems: 3.0.3 - /usr/bin/gem
Utilities:
CMake: 3.13.0 - /usr/local/bin/cmake
Make: 3.81 - /usr/bin/make
GCC: 4.2.1 - /usr/bin/gcc
Git: 2.19.0 - /usr/local/bin/git
Clang: 1103.0.32.62 - /usr/bin/clang
FFmpeg: 4.0.2 - /usr/local/bin/ffmpeg
Servers:
Apache: 2.4.46 - /usr/sbin/apachectl
Virtualization:
Docker: 20.10.2 - /usr/local/bin/docker
SDKs:
iOS SDK:
Platforms: DriverKit 19.0, macOS 10.15
IDEs:
Nano: 2.0.6 - /usr/bin/nano
VSCode: 1.52.1 - /usr/local/bin/code
Vim: 8.2 - /usr/bin/vim
Xcode: 11.7/11E801a - /usr/bin/xcodebuild
Languages:
Bash: 5.0.11 - /usr/local/bin/bash
Go: 1.11.1 - /usr/local/bin/go
Elixir: 1.9.1 - /usr/local/bin/elixir
Erlang: 22.0.7 - /usr/local/bin/erl
Java: javac 11 - /usr/bin/javac
Perl: 5.28.2 - /usr/bin/perl
PHP: 7.3.24 - /usr/bin/php
Python: 2.7.17 - /usr/local/bin/python
Python3: 3.9.1 - /usr/local/bin/python3
Ruby: 2.6.3 - /usr/bin/ruby
Rust: 1.42.0 - /Users/cdaringe/.cargo/bin/rustc
Databases:
SQLite: 3.32.3 - /usr/bin/sqlite3
Browsers:
Chrome: 87.0.4280.88
Firefox: 84.0.1
Safari: 14.0.2
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 25 (17 by maintainers)
If we can get to the bottom of it. Does changing the type help?