-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Karma test run fails unless entry: is specified in webpack config #134
Comments
Actually, take a raincheck on that. I've just spun up another test project to test karma (now there's a circular reference....) and I'm not getting the above scenario. I'll come back with more information once I offload some expletives. |
Status update. I've a repo here which sows the problem. My last comment was a false negative somehow. |
Further testing provides evidence that this is indeed an issue with webpack-plugin.
from the webpack.config file. And then comment out the async test in the spec, and the import statements. (So that effectively the only test is a simple Then everything runs just fine. |
We should be able to get this work but it will need a very specific configuration.
First thing I need to fully understand here is: what does karma do to the webpack config exactly? It must modify it because if webpack would really have no entry point, then the bundle would be empty and do nothing. |
I'm by no means a Karma, nor a karma-webpack expert. I recall reading somewhere that the entry is passed into webpack somehow from Karma. I'll see if I can dig up the details of exactly how this is done. |
Here is what I have been able to decipher so far. I'm hoping your knowledge of webpack-dev-middleware is better that mine. Under the hood karma-webpack looks like it uses webpack-dev-middleware to run the webpack process. Again looking through the karma-webpack source, I think the source *.spec.ts files are added to the in memory filesystem of webpack-dev-middleware by karma-webpack, but I have been unable to understand how things get bundled (or entry any entry points specified) from there. If AureliaPlugin is adding to the |
Yes, the failure is because Specifically, this is done by calls to The problem is that these things have to be set up for an Aurelia app to work properly and we need to find a way to do it in a way that's compatible with the way Karma runs things.
So, if you set To run fine, you would at least need to load |
I'm submitting a bug report
Versions ->
webpack-plugin 2.0.0-rc.5
Windows 10
Node 8.9.4
NPM 5.6.0
Webpack 3.10.0
Karma 2.0.0
Karma-webpack 2.0.9
Chrome 63.0.3239.132
Typescript 2.6.2
Current behavior:
Bare bores webpack.config just for test running.
Without
plugins:[ new AureliaPlugin()]
in the webpack config tests execute as expected.But once the preceeding plugin is defined I receive error TypeError: request.replace is not a function after running
karma start
The webpack config above does not have an
entry:
defined. (as it does not need it for Karma).However if I add and
entry:
with any string (other than an empty string - these error still), such as the path of the only test spec file, or "ImaRandomString". Then the error goes away and tests run again.But webpack then tries to emit a main module in addition to the spec test, and also spams the console with ERROR in multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry ./test/specs.ts Module not found: Error: Can't resolve 'aurelia-webpack-plugin/runtime/empty-entry' in [my project]
I've tried removing the
entry:
in the webpack config, and specifying some options in the AureliaPlugin ctor but all attempts still yeild the original error and no tests nun.Expected/desired behavior:
It appears webpack-plugin in dependant on the
entry:
config setting in the webpack.config API and should not be ?The text was updated successfully, but these errors were encountered: