Registry / testing / karma-es6-shim

karma-es6-shim

JSON →
library1.0.0jsnpmunverified

Karma plugin that includes both es5-shim and es6-shim polyfills for testing ES6 features in PhantomJS. Version 1.0.0, last updated in 2016. Designed for projects using AMD/RequireJS and Babel transpilation. Simplifies configuration by ensuring both shims are loaded in the correct order for PhantomJS, which lacks ES5 and ES6 support. No active maintenance since 2016.

npm install karma-es6-shim
INSTALL
IMPORT
SIG · KARMA-ES6-SHIM
K
karma-es6-shim
testingjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

framework:es6-shim
frameworks: ['es6-shim']
plugins: ['karma-es6-shim']
Register it as a framework name, not a plugin. Must be listed after 'requirejs' in frameworks array.
Default import
// no import needed; just add 'es6-shim' to 'frameworks'
const es6Shim = require('karma-es6-shim')
This package is a Karma framework, not a module to import. It requires no require() for configuration.
ESM import
// Not applicable; configuration is done in karma.conf.js via CommonJS
import 'karma-es6-shim'
Karma config files are CommonJS. Do not use ESM imports for this package.

Install karma-es6-shim and add 'es6-shim' to the frameworks array after 'requirejs' in karma.conf.js to load ES5 and ES6 polyfills for PhantomJS.

// Install the package npm install karma-es6-shim --save-dev // In karma.conf.js module.exports = function(config) { config.set({ frameworks: ['requirejs', 'es6-shim'], // ... other config }); };
Debug
Known issues
deprecatedPackage is abandoned; last release in 2016. ES6-shim is largely unnecessary for modern browsers and PhantomJS is no longer maintained.
fix
Consider using Karma with a modern headless browser (e.g., ChromeHeadless) that natively supports ES6, or use Babel's polyfill instead.
affects: >=1.0.0
gotchaMust add 'es6-shim' to frameworks AFTER 'requirejs', not as a plugin. If listed incorrectly, shims may not load.
fix
Ensure frameworks array is ordered as ['requirejs', 'es6-shim'].
affects: >=1.0.0
gotchaRequires PhantomJS with RequireJS. If not using RequireJS, the polyfills may not be injected properly.
fix
This package is designed for AMD/RequireJS setups. For other module systems, use es6-shim directly as a plugin or via script tags.
affects: >=1.0.0
Errors
Common errors & fixes
Uncaught TypeError: Array.prototype.find is not a function
PhantomJS does not support ES6 methods like Array.find, and the package is not loading polyfills.
fix
Ensure 'es6-shim' is included in karma.conf.js frameworks array after 'requirejs'.
Module 'es6-shim' is not available
Missing npm dependency or incorrect Karma configuration (e.g., frameworks order).
fix
Run 'npm install karma-es6-shim --save-dev' and verify frameworks array in karma.conf.js.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
karmarequiredpeer dependency required for Karma framework integration
es5-shimrequiredloaded as a dependency for ES5 polyfill
es6-shimrequiredloaded as a dependency for ES6 polyfill
Agent activity
4 hits · last 30 days
node
4
Resources
karma-es6-shim — npm install karma-es6-shim · libregistry