I am writing a JavaScript library that uses the new es6 promises. I can test the library in Firefox because promises are defined. However, when I try to test my code with Karma
For Babel 6, we need install babel-polyfill
to support promise.
npm install --save-dev babel-polyfill
and add a line in karma.conf.js
within the files
section
files: [
'node_modules/babel-polyfill/dist/polyfill.js',
....
]
It's well documented in https://github.com/babel/karma-babel-preprocessor#polyfill