connor4312 / nodejs-testing

VS Code integration for node:test native tests
MIT License
43 stars 6 forks source link

breakpoints not stoppable with certain libraries bundled #9

Open joergplewe opened 1 year ago

joergplewe commented 1 year ago

Dear admired authors,

I ran across a daily-work issue that might or might not be a bug concerning starting the debugger from the plugin. In my case I use to bundle the test using esbuild. In some cases depending on the libs included, the debugger runs the test but won't stop at breakpoints.

I managed to condense that into a minimal example: node_test_runner_no_breakpoints.zip

Quoting the README:

This works:

  • npm install
  • npm run bundle
  • npm test

There are issues stopping on breakpoints when starting the debugger from the node:test runner plugin.

Debugging using the VSCode debugging feature using launch config unit test always works.

Depending on whether lodash or underscore are included, stopping on breakpoints works or it doesn't.

There are other libraries - when included - prevent the debugger from stopping at breakpoints. We tried rxjs and pixi.js.

For this sample we used lodash and underscore because they are both quite small and very similar.