config.set({
plugins: [
require('karma-babel-preprocessor'),
require('karma-chrome-launcher'),
require('karma-jasmine'),
require('karma-phantomjs-launcher'),
require('karma-safari-launcher'),
require('karma-spec-reporter'),
],
preprocessors: {
'app/**/*.spec.js': ['babel'],
'app/components/my.lazy.module.js': ['babel']
},
babelPreprocessor: {
options: {
presets: ['es2015'],
plugins: ['syntax-dynamic-import']
}
},
files: [
'app/dest/app.js',
'app/dest/*.bundle.js',
'app/components/my.lazy.module.js',
'node_modules/angular-mocks/angular-mocks.js',
'node_modules/babel-polyfill/dist/polyfill.js',
'app/**/*.spec.js'
],
frameworks: [
'jasmine'
],
reporters: [
'spec'
],
beforeEach(inject(($ocLazyLoad) => {
import(/* webpackChunkName: "my.lazy" */ 'base/app/components/my.lazy.module.js')
.then(mod => {
return $ocLazyLoad.inject(mod.MyLazyModule);
})
}));