Load patches for Jasmine, or polyfills like core-js/stable
and @babel/polyfill
, before running Karma tests.
-
Install the plugin with
npm
:npm install @aleen42/karma-polyfill --save-dev
-
Configure Karma to load the plugin as a framework:
// karma.config.js module.exports = config => { config.set({ frameworks : [ 'jasmine', 'polyfill', // ... ], plugins : [ 'karma-jasmine', '@aleen42/karma-polyfill', // ... ], // ... }); };
-
If you want to test under IE7 / IE8, you may need the shimmed Jasmine framework:
// karma.config.js module.exports = config => { config.set({ frameworks : [ - 'jasmine', + 'jasmine-polyfill', 'polyfill', // ... ], plugins : [ - 'karma-jasmine', + '@aleen42/karma-polyfill/jasmine', '@aleen42/karma-polyfill', // ... ], // ... }); };
- ==================== 1.0.0 Initial release ====================
- 1.0.1 shims for Karma and Jasmine under IE7 / IE8
Have an idea? Found a bug? See How to contribute.
MIT © aleen42
For more information on Karma see the homepage.