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

fix(webpack): fix broken karma tests in webpack v4 #998

Closed

Conversation

chrisckc
Copy link
Contributor

@chrisckc chrisckc commented Dec 5, 2018

Fixes error: "Module not found: Error: Can't resolve 'fs' in"
Fixes issue where tests dont run in webpack v4

Fixes: #996

Fixes error: "Module not found: Error: Can't resolve 'fs' in"
Fixes issue where tests dont run in webpack v4

Fixes: aurelia#996
@@ -43,6 +43,7 @@ module.exports = ({ production, server, extractCss, coverage, analyze, karma } =
// out-of-date dependencies on 3rd party aurelia plugins
alias: { 'aurelia-binding': path.resolve(__dirname, 'node_modules/aurelia-binding') }
},
node: { fs: 'empty' }, // Fixes issue: "Error: Can't resolve 'fs'" when running karma tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In normal run, webpack stubs nodejs core module like fs. What's the issue with our webpack+karma setup?

Maybe we should fix our karma.conf.js instead of webpack.config? Because fs is not the only nodejs core module, if you fix the issue here, you need lot more than just fs: 'empty'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I don't know much about the karma config, feel free to modify the PR for the best solution.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am no master of karma either. I just don’t understand the nature of this recent webpack karma issue.
Personally I try to avoid both webpack and karma as much as possible :)

@3cp
Copy link
Member

3cp commented Feb 5, 2019

With revert of #970, this is not needed anymore.
@EisenbergEffect this can be closed.

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

Successfully merging this pull request may close these issues.

Karma unit test failures: Cant resolve fs, no tests run
3 participants