567d9d2a24
This commit adds karma-chrome-launcher and changes karma's settings to use Chrome for all unit tests, removing PhantomJS. This change is mainly to avoid downloading PhantomJS during gate tests, as the phantomjs platform binaries would be downloaded from bitbucket and their download servers have been returning rate limiting jobs and returning 429 errors, leading to failed test runs. Since Chrome is automatically installled from local mirrors, this should avoid the problem entirely. Change-Id: I5aba5480b34c4b4a6646f96c382c010495b3ea1b
76 lines
1.3 KiB
JavaScript
76 lines
1.3 KiB
JavaScript
'use strict';
|
|
|
|
var istanbul = require('browserify-istanbul');
|
|
var isparta = require('isparta');
|
|
|
|
module.exports = function(config) {
|
|
config.set({
|
|
|
|
basePath: '../',
|
|
|
|
frameworks: ['jasmine', 'browserify'],
|
|
|
|
files: [
|
|
// app-specific code
|
|
'app/js/main.js',
|
|
// 3rd-party resources
|
|
'node_modules/angular-mocks/angular-mocks.js',
|
|
// test files
|
|
'test/unit/**/*.js'
|
|
],
|
|
|
|
preprocessors: {
|
|
'app/js/**/*.js': ['browserify', 'babel', 'coverage']
|
|
},
|
|
|
|
reporters: ['spec', 'coverage'],
|
|
|
|
port: 9876,
|
|
|
|
colors: false,
|
|
|
|
logLevel: config.LOG_INFO,
|
|
|
|
autoWatch: true,
|
|
|
|
browsers: ['Chrome'],
|
|
|
|
singleRun: true,
|
|
|
|
plugins: [
|
|
'karma-babel-preprocessor',
|
|
'karma-browserify',
|
|
'karma-coverage',
|
|
'karma-jasmine',
|
|
'karma-spec-reporter',
|
|
'karma-chrome-launcher'
|
|
],
|
|
|
|
browserify: {
|
|
debug: true,
|
|
transform: [
|
|
'bulkify',
|
|
istanbul({
|
|
instrumenter: isparta,
|
|
ignore: ['**/node_modules/**', '**/test/**']
|
|
})
|
|
]
|
|
},
|
|
|
|
coverageReporter: {
|
|
type: 'html',
|
|
dir: 'cover',
|
|
instrumenterOptions: {
|
|
istanbul: {noCompact: true}
|
|
}
|
|
},
|
|
|
|
proxies: {
|
|
'/': 'http://localhost:9876/'
|
|
},
|
|
|
|
urlRoot: '/__karma__/'
|
|
});
|
|
|
|
};
|