Comments (6)
Thanks! Was able to fix the problem with:
const fixMocha = function(files) {
files.unshift({
pattern: path.resolve('./node_modules/core-js/client/core.js'),
included: true,
served: true,
watched: false
});
};
fixMocha.$inject = ['config.files'];
module.exports = (config) => {
config.set({
...
frameworks: ['mocha', 'inline-mocha-fix'],
plugins: [
'karma-*',
{
'framework:inline-mocha-fix': ['factory', fixMocha]
}
],
...
});
};
I'm using core-js but I think it should work with other libraries as well
from karma-mocha.
+1 On this.
Having the same problem testing on Saucelab with ie9.
from karma-mocha.
@Inf3rno you could create custom inline framework
. For example:
frameworks: ['mocha', 'inlnie-mocha-fix'],
plugins: [
'karma-*',
{
'framework:inline-mocha-fix': ['factory', function() {
...
}]
}
],
https://karma-runner.github.io/2.0/dev/plugins.html
By the way, I think it's a mocha's bug so feel free open issue there
Thanks!
from karma-mocha.
@dwightjack Thanks, it looks great! :-)
from karma-mocha.
By the way, I think it's a mocha's bug so feel free open issue there
The Mocha devs officially dropped support for IE9 & IE10 in v5 of Mocha. See mochajs/mocha#3164.
So one might argue that this is a feature rather than a bug 😉
from karma-mocha.
Anyway, do I understand correctly that the described approach polyfills everything that is loaded instead of just mocha?
If that is indeed the expected behavior, I don't think this is a suitable approach for a test runner.
The whole point of testing in IE9 & IE10 is usually to detect whether those browsers don't break because you rely on features not present in such old browsers. Adding a polyfill for ES6 features in your test environment kinda prevents you from detecting this problem.
I'd rather just use Mocha v4 instead.
from karma-mocha.
Related Issues (20)
- Passed --grep option persists across test runs HOT 1
- npm test - Uncaught ReferenceError: describe is not defined HOT 3
- No provider for "framework:mocha"! (Resolving: framework:mocha) HOT 11
- karma tests slowed down with mocha 4
- Can I keep tests in a normal mocha index.html? HOT 3
- Delay __karma__.start() until es6 test modules have been loaded HOT 1
- maintainers and status of project HOT 4
- Usage of exact version of minimist HOT 4
- When will commit: 36404cf36aa5150f839c98d10baa8c642faad098 will be relaesed? HOT 1
- Uncaught exception: emitting a 'test end' event for a hook HOT 1
- Redundant Mocha Reporter Node <div id="mocha"></div> HOT 1
- Uncaught exceptions in between Mocha tests are not reported HOT 2
- Support for mocha root hooks
- adapter.js swallows failures that occur after test complete
- Unit tests are missing when `script type="module"` takes >= 3ms before `describe` HOT 1
- Reestablish CI/CD with GitHub Actions
- The dependency minimist "^1.2.3" is declared as vulnerable need to update to 1.2.6 or more HOT 1
- Status of this project? HOT 4
- Analysis: 76% of dependency updates in this repository can be merged.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karma-mocha.