Created
October 19, 2016 09:46
-
-
Save Swiip/eda19dda3664a7e40f01c862be601c21 to your computer and use it in GitHub Desktop.
"Testing an AngularJS app with Jest" karma code sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (config) { | |
config.set({ | |
basePath: '../', | |
singleRun: true, | |
autoWatch: false, | |
files: [ | |
'node_modules/angular/angular.js', | |
'node_modules/angular-mocks/angular-mocks.js', | |
'src/app/mock/utils.js', | |
'src/index.spec.js' | |
], | |
frameworks: ['jasmine'], | |
preprocessors: { | |
'src/index.spec.js': ['webpack'] | |
}, | |
browsers: ['Chrome'], | |
reporters: ['progress', 'coverage'], | |
webpack: require('./webpack-test-coverage.conf'), | |
webpackMiddleware: { noInfo: true }, | |
junitReporter: { outputDir: 'test-reports' }, | |
coverageReporter: { | |
reporters: [ | |
{type: 'cobertura', dir:'test-coverage/', subdir:'.'}, | |
{type: 'lcov', dir:'test-coverage/', subdir:'.'} | |
] | |
}, | |
plugins: [ | |
require('karma-jasmine'), | |
require('karma-junit-reporter'), | |
require('karma-coverage'), | |
require('karma-chrome-launcher'), | |
require('karma-webpack') | |
] | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment