-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Using native es6 modules (files type='module'), __karma__.start() is launched before modules are loaded #2955
Comments
My first opignion: Because I see:
I think that the listing of all the tests is launched before the loading of the module. If I then run I correctly see the "in it..." So I think that the bug (unwanted feature) is that "karma.start()" is started too early. |
In the karma.conf.js, the file is referenced here: And with the PR, it works |
In case it's helpful, if you load an initial |
And I realized that loading an initial html file relies on html imports, which are a dead spec, and you have to somehow include a polyfill before context.html to get it to work outside of Chrome, so now I'm back to this issue. |
Looks like #2834 should solve the issue once it is merged. |
Is this solved? If so can someone please give me an example or something of how to get Karma to work with native ES6 modules? To be clear I mean Karma support without having to bundle or transpile existing fully functionally native ES6 modules |
I managed to get it to work by reading through the merged code. In the configuration file, you can use patterns to indicate the type of script used:
|
http://karma-runner.github.io/4.0/config/files.html
|
I don't know who on the team is responsible for this, but I'm pretty sure this issue can be closed, since #3072 officially added es6 module support. (I can't get my actual code to work with it since it relies heavily on node-style module resolution, but that's my own fault...) |
Closing as per above. |
I would like to run native es6 modules in chrome, without any transcoding.
And first things: loading the modules works !!!
in coherence.js (first test suite), I have
In my browser, I see "in describe..." but never "in it..."
Expected behaviour
I would expect some tests to run
And "in it..." to be show in console
Actual behaviour
It fails with:
In the browser console, I see:
Environment Details
karma --version
): 2.0.0karma.config.js
fileSteps to reproduce the behaviour
This repo reproduce the problem, on the es6 branch:
3a. npm run test
3b. npm run test-continuously
The text was updated successfully, but these errors were encountered: