Skip to content
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

Using a requires shim (tsx, esbuild-register, @swc-node/register) causes breakpoint sourcemaps to not work #18

Open
JustinGrote opened this issue Jan 5, 2024 · 0 comments

Comments

@JustinGrote
Copy link

JustinGrote commented Jan 5, 2024

.vscode-test.js

module.exports = {
  files: '**/*.test.ts',
  cachePath: `${__dirname}/../../.vscode-test`,
  mocha: {
    ui: 'bdd',
    preload: 'esbuild-register'
  },
};

Using "sourcemapped" example and debug mode in the test runner.

Tests run fine and the transpiler requires shim works fine for mocha to transpile the ts file in-place, but when the breakpoint hits, it does not recognize the sourcemap and go to the original file:
image

This works just fine when using mocha on the command line regularly.

This is potentially a js-debug extension issue or some odd combination about running mocha inside the vscode electron compiled app, but I wanted to start the conversation here because I didn't observe this behavior when I wrote my own custom mocha test runner for Pester.

Workaround

Toggle over to the original file to make edits rather than being able to edit-in-place, so this is mostly just an efficiency annoyance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant