-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Module paths are messed up #41
Comments
This is likely caused by the same issue in #40. We need to wrap all files to provide the proper paths for https://github.com/twolfson/karma-electron/blob/6.1.1/lib/node-integration-iframe.mustache.js#L36 Please see README for setting up https://github.com/twolfson/karma-electron/tree/6.1.1#getting-started |
First of all, thanks for your great work on issue #40. I migrated the test project to version 6.3.0 and added You can review all my changes to a default Angular installation here: https://github.com/Jusonex/karma-electron-testapp/compare/ddbab1e...master I also added a |
Okay, let's start from the beginning to I fully understand the issue What is the behavior you're seeing on launch? Are tests running? What's the expected behavior? |
No, because it errors before tests are executed.
I expect the error message to not appear and tests run successfully. In |
Ah, okay. It sounds like that could be us but it could also be a configuration error or a missing plugin The repo has too much content for me to quickly and easily verify that the issue is |
Description
If the
nodeIntegration
is enabled via the workaround mentioned in #38 (comment), it seems to mess up the module paths which leads to modules not being able to be loaded fromnode_modules
.Precisely, outputting the value of
module.paths
in the Electron window (via devtools) gives me:This does not comply with the behaviour of a "directly launched" Electron which also adds the
node_modules
folder of the directory it is launched from to the module search path.Essentially, this behaviour leads to modules that are placed in
node_modules
not being found.Reproduction
npm install
require
hackfix by adding arequire
line with the absolute path to the nodeIntegration enable script after https://github.com/twolfson/karma-electron/blob/master/lib/electron-launcher.js#L40-L42npm test
require('lodash')
module.paths
The text was updated successfully, but these errors were encountered: