-
Notifications
You must be signed in to change notification settings - Fork 75
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
Use with VS Code #29
Comments
I don't use VS Code, but it's perhaps similiar to Intellij's mocha plugin. The following config works for me. Have a look at webpack.config.test.js
Moreover i had to include |
Thanks for the suggestion. The devtool- options fixed VS Code debugging of my manual test build, but Code still doesn't attach to mocha-webpack. I tried "--require source-map-support/register", but it breaks both mocha and mocha-webpack with the following error:
|
I managed to fix the source-map-support syntax error by adding the 'node' environment option: evanw/node-source-map-support#137 The VS Code attachment issue remains though. |
+1 |
|
Are you manage to run it?
but it's the same webpack config that I run in the console. what can be the problem here? |
Does anybody have any success with that? |
+1, not been able to debug tests in vscode using mocha-webpack. Any updates? |
I have tried the following code is feasible, but I don't know why. webpack.config.js if (process.env.NODE_ENV === "test") {
//If you would to use breakpoint in vscode, then must be set devtool to "eval" base
config.devtool = "eval";
config.output = Object.assign(config.output, {
devtoolModuleFilenameTemplate: "[absolute-resource-path]",
});
} .vscode/launch.json {
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Mocha-webpack Tests",
"program": "${workspaceFolder}/node_modules/mocha-webpack/bin/mocha-webpack",
"args": [
"--full-trace",
"--timeout",
"999999",
"--colors",
"tests/**/*.js"
],
"sourceMaps": true,
"env": {
"NODE_ENV": "test"
},
"internalConsoleOptions": "openOnSessionStart"
}]
} |
I'd like to use Visual Studio Code's debugger with mocha-webpack tests. VS Code can debug mocha tests, but you have to tell it to use "node_modules/mocha/bin/_mocha" and not "mocha".
For mocha-webpack I tried both "node_modules/mocha-webpack/bin/mocha-webpack" and "node_modules/mocha-webpack/bin/_mocha" and it would run the tests but not attach the debugger. Not sure what is going wrong. Possibly related to #19
The text was updated successfully, but these errors were encountered: