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

Debugging ESM works but not Running #365

Open
jogibear9988 opened this issue May 24, 2024 · 1 comment
Open

Debugging ESM works but not Running #365

jogibear9988 opened this issue May 24, 2024 · 1 comment

Comments

@jogibear9988
Copy link

I'm able to configure the jest runner to add --experimental-vm-modules for the debug comand, but not for run.

My config looks like this:

"settings": {
	"jestrunner.debugOptions": {
		"runtimeArgs": [
			"--experimental-vm-modules"
		]
	}
}

when I use "debug" the commandline lloks like this:

  /usr/bin/env 'NODE_OPTIONS= --require "/Applications/Visual Studio Code - Insiders.app/C
  ontents/Resources/app/extensions/ms-vscode.js-debug/src/bootloader.js"  --inspect-publish-uid=http' 'VSCODE_INSPECTOR_OPTIONS=:::{"inspectorIpc
  ":"/var/folders/dm/7fjzn8gd7v17k4018lb4pnwc0000gn/T/node-cdp.1136-5084c36a-25.sock","deferredMode":false,"waitForDebugger":"","execPath":"/usr/
  local/bin/node","onlyEntrypoint":false,"autoAttachMode":"always","fileCallback":"/var/folders/dm/7fjzn8gd7v17k4018lb4pnwc0000gn/T/node-debug-ca
  llback-87f4a491c48e5421"}' /usr/local/bin/node --experimental-vm-modules node_modules/.bin/jest /Users/jochenkuehner/Desktop/repos/github/nodep
  rojects/web-component-designer/packages/web-component-designer/tests/SpecificityCalculator.test.ts -c /Users/jochenkuehner/Desktop/repos/github
  /nodeprojects/web-component-designer/packages/web-component-designer/jest.config.js -t test\ 1 --runInBand 

but when I use the "run" it does not work.

I then tried to add:

	"jestrunner.runOptions": [
		"--experimental-vm-modules"
	]

but this will not add the --experimental-vm-modules to node, but as a parameter for jest

@AlessioGr
Copy link

AlessioGr commented Jun 6, 2024

This is how we got it to work for both running and debugging

"jestrunner.jestCommand": "pnpm exec cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-deprecation\" node 'node_modules/jest/bin/jest.js'",
"jestrunner.debugOptions": {
  "runtimeArgs": ["--experimental-vm-modules", "--no-deprecation"]
}

Hope that helps!

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

2 participants