Skip to content

Instantly share code, notes, and snippets.

@PizzaPete
Last active July 14, 2016 13:40
Show Gist options
  • Save PizzaPete/eaf476fae91d9f1a0969 to your computer and use it in GitHub Desktop.
Save PizzaPete/eaf476fae91d9f1a0969 to your computer and use it in GitHub Desktop.
Karma configuration for testing Angular with ES2015
var browsers = ['Chrome'];
var options = {
basePath: '',
browsers: browsers,
frameworks: ['browserify', 'jasmine'],
autoWatch: true,
singleRun: true,
preprocessors: {
'src/asset/javascript/**/*.js': ['babel', 'browserify'],
'src/asset/javascript/**/*.html': ['ng-html2js']
},
files: [
'src/asset/javascript/app.module.js',
'node_modules/angular-mocks/angular-mocks.js',
'src/asset/javascript/**/*.spec.js',
'src/asset/javascript/**/*.html'
],
ngHtml2JsPreprocessor: {
moduleName: 'templates'
},
browserify: {
debug: true,
transform: [
require('browserify-istanbul')({
instrumenter: require('isparta'),
ignore: ['**/node_modules/**', '**/*.spec.js']
}),
'babelify',
'browserify-ngannotate'
]
},
reporters: [
'progress',
'coverage'
]
};
module.exports = function(config) {
config.set(options);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment