-
-
Notifications
You must be signed in to change notification settings - Fork 222
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 support #306
Karma support #306
Conversation
* Currently requires installing a whole mess of karma plugins locally to verify. Next step is to use a node require mocking framework to avoid this
* Track optional dependencies in the repo, across platforms
Codecov Report
@@ Coverage Diff @@
## master #306 +/- ##
==========================================
- Coverage 98.05% 97.74% -0.32%
==========================================
Files 30 31 +1
Lines 462 531 +69
==========================================
+ Hits 453 519 +66
- Misses 9 12 +3
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #306 +/- ##
==========================================
+ Coverage 98.11% 98.39% +0.28%
==========================================
Files 30 32 +2
Lines 477 561 +84
==========================================
+ Hits 468 552 +84
Misses 9 9
Continue to review full report at Codecov.
|
b3cca8c
to
34fd865
Compare
src/special/karma.js
Outdated
const frameworkMapping = {}; | ||
// skip plugins with more specific names, such as launchers and reporters | ||
karmaPluginsInstalled.filter(plugin => !plugin.endsWith('-launcher') && !plugin.endsWith('-reporter')).forEach((genericPlugin) => { | ||
const p = tryRequire(genericPlugin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This specific approach - using node's require to try to pull in the relevant module - seems to be against the philosophy of the rest of the project. Sadly the information we need to resolve frameworks/browsers/reporters/etc to plugins isn't quite available statically, which means we need to find the default module in each plugin and parse out the map from its module.export. Any guidance on how to do that cheaply would be much appreciated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opted to replace it with parser code, so I can guarantee it works in my own project.
…m instead * node require is not looking at the modules of the project under test, so we have to find the plugin metadata ourselves * add resolve@1.10.0 as a dependency so this can work * restructured karma special and its test to work with these new dependencies. Good news: no need for proxyquire to inject globals now
The build fails on node 6, I'm not against dropping node 6 support... |
* Supports only a simplified use of karma.conf.js where the caller passes a literal object expression, with string literals for keys and values in all supported config properties * Avoids problems loading node dependencies for config or plugin modules, while still extracting the important parts of the relevant files
094cb93
to
53703b3
Compare
* Improves backwards compatibility with node 6 on appveyor, until we get an updated version of @babel/polyfill working
It's easy enough to stop using |
* Turns out I never needed the keys in this call anyway
🎉 Thanks! |
Implements #188