New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable debugging of AVA based test in TypeScript application using VS Code #2579
Comments
I use https://github.com/avajs/typescript. It works great with debug terminals. Beyond that you need to create a launch configuration.
That's a third-party plugin so I can't help you with that 😄 |
Thank you for quick response. Unfortunately I am seeing this error when trying to run tests:
Nevertheless if I run command from terminal: PathToProject\node_modules.bin\ava.CMD PathToProject\tests\my.test.ts --inspect-brk=18225 It works and test is executed. |
Could you share your AVA version and configuration? |
Ava configuration in package.json
version: Thanks. |
You're not using the latest version. Try with AVA 3 instead, and remove the top-level (I'm closing this issue for housekeeping purposes, but let's keep the conversation going.) |
thank you. With changes you proposed error got limited to I suppose I don't have full understanding of rewrite paths Project directory structure: tests Please can you give me bit more guidance on rewrite paths? |
How are you invoking AVA? I'm not immediately sure if the default patterns select your test file. You could try adding |
This is my Launch.json file:
as said it seem to produce correct command, nevertheless it does not work when invoked thru VS Code debug, but works from terminal |
I think that ought to work, but I must admit I haven't tried the launch configuration since VSCode made it easier to create a debug terminal. |
I was trying to debug typescript tests from Visual Studio Code, but I received error saying "Test files must be run with the AVA CLI". It would be nice to have possibility to set breakpoints directly in the typescript test files, what seems not possible at this point. I managed to configure ava to transpile typescript files and run the tests from command line, nevertheless I am interested in having debugging experience provided by VS Code.
I also tried the AVA Test Explorer extensions for VS Code, but it seem not to support Typescript.
I would like to ask, if there is some way how to enable debugging of tests when using ava in combination with Typescript.
The text was updated successfully, but these errors were encountered: