karma plugin to inject js-polyfills.
npm install karma-js-polyfillsjs-polyfills for karma.
``bash`
npm install --save-dev karma-js-polyfills
Add js-polyfills to the frameworks in your karma configuration.
`js
module.exports = config => {
config.set({
// ...
frameworks: ['mocha', 'chai', 'js-polyfills'],
// ...
});
};
`
Without configuration, this plugin inject polyfill.js, which is main file of the js-polyfills.
To customize the injected file list, Add an array of polyfill names as jsPolyfills key to your karma configuration.
`js
module.exports = config => {
config.set({
// ...
jsPolyfills: ['typedarray', 'timing'],
// ...
});
};
`
Then, typedarray.js and timing.js` will be enabled.