Open LilSebastian5000 opened 5 years ago
Was able to fix this issue by adding the following to my package.json (NOT included with aurelia-cli):
"babel-plugin-istanbul": "5.1.1"
That got rid of my initial error. From there, I got the same error that was mentioned in #996 , and was able to fix it by adding this to my webpack.conf.js:
node: {fs: 'empty'},
I'm not sure if that has any negative effect on a deployed app in the long-run.
**Note, I did not end up needing "coverageIstanbulReporter" in my karma.conf.js in order to fix this issue.
The webpack setup comes with both au karma
and au jest
. Maybe you can use jest for the time being.
The webpack setup comes with both
au karma
andau jest
. Maybe you can use jest for the time being.
Thanks for the suggestion, that may be a good tool to look into in the future!
I'm not quite sure the effort involved in converting an application from Karma to Jest without looking into it further, so I've been trying to stick with what we have for now because we have a large application with a high user base and over 1000 tests run through Karma, so if we can get away with as little changes as possible while upgrading everything, the better off we are.
Luckily seems like those minimal changes I made got it working, hopefully a change will get merged into the next release of aurelia-cli now that I've provided reproducible steps to fix :)
The cli generated webpack skeleton comes with both commands (au karma and au jest) by default.
Try au jest
, if all tests pass, nothing needs to be done for the converting :)
This should be fixed by reverting #970.
https://github.com/huochunpeng/cli/commit/3c4d0d6bc8b61554a5fc29f57bd5468412123fb6
☝️Can you try update your webpack.config.js and try au karma
again?
I'm submitting a bug report
Please tell us about your environment:
Operating System: Windows 10
Node Version: 8.9.0
NPM Version: 6.5.0
Browser: Chrome / All
Language: ESNext
Loader/bundler: Webpack
Current behavior: Karma tests fail to run with the following error:
I found this issue: https://github.com/aurelia/cli/issues/996 and saw that the latest karma-webpack version is incorrect, so I installed "4.0.0-rc.3" as suggested. This did not fix the issue. I also noticed someone mentioned that the following would need to be added to karma.conf.js, but this also did not fix the issue:
What is the expected behavior?
Tests should successfully run
What is the motivation / use case for changing the behavior? I'm trying to upgrade my aurelia project from webpack 3 to webpack 4, but since the aurelia skeleton isn't up to date, and the aurelia-cli is broken, I don't have a valid setup to reference.