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

Configuring VS Code Test Explorer with electron-mocha #215

Open
jjeff opened this issue Oct 7, 2024 · 0 comments
Open

Configuring VS Code Test Explorer with electron-mocha #215

jjeff opened this issue Oct 7, 2024 · 0 comments

Comments

@jjeff
Copy link

jjeff commented Oct 7, 2024

This may be a topic for the Wiki, but I've been figuring out how to run Mocha tests on my Electron code in the Test Explorer in VS Code. I've got it working just fine in the Debugger (maybe another topic for the Wiki). But I can't seem to configure my tests to load in the Test Explorer.

I'm using Mocha Explorer, but I can't figure out how to tell it to use electron-mocha instead of (plain old) mocha. Of course, with plain old mocha I get errors that app and ipcMain are undefined, but when I set

  "mochaExplorer.mochaPath": "node_modules/electron-mocha/bin/electron-mocha",

in settings.json, I get an error saying

TypeError: Cannot read properties of undefined (reading 'bdd')
    at patchMocha (/Users/jeff/.vscode/extensions/hbenl.vscode-mocha-test-adapter-2.14.1/out/worker/bundle.js:870:64)
    at /Users/jeff/.vscode/extensions/hbenl.vscode-mocha-test-adapter-2.14.1/out/worker/bundle.js:5775:17
    at Generator.next (<anonymous>)
    at fulfilled (/Users/jeff/.vscode/extensions/hbenl.vscode-mocha-test-adapter-2.14.1/out/worker/bundle.js:114:58)

But without it, I get errors about app being undefined.

Any thoughts?

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