redoc/karma.conf.js

76 lines
2.3 KiB
JavaScript
Raw Normal View History

2015-12-10 00:46:27 +03:00
module.exports = function (config) {
2015-12-13 13:37:58 +03:00
var travis = process.env.TRAVIS;
2015-12-10 00:46:27 +03:00
config.set({
frameworks: ['phantomjs-shim', 'jspm', 'jasmine', 'sinon', 'should'],
2015-12-13 13:37:58 +03:00
preprocessors: {
2015-12-19 01:53:33 +03:00
'lib/**/!(*spec).js': ['babel', 'regex', 'coverage']
},
regexPreprocessor: {
rules: [
[ /'\.(.*?)\.css'/g, '\'.tmp$1.css\'']
]
2015-12-13 13:37:58 +03:00
},
babelPreprocessor: {
options: {
sourceMap: 'inline',
"optional": [
"runtime",
"optimisation.modules.system",
"es7.decorators",
"es7.classProperties"
]
},
sourceFileName: function(file) {
return file.originalPath;
}
},
2015-12-10 00:46:27 +03:00
2015-12-13 13:37:58 +03:00
coverageReporter: {
instrumenters: { isparta : require('isparta') },
instrumenter: {
'lib/**/!(*spec).js': 'isparta'
},
dir: 'coverage/',
reporters: [
{type: 'html'},
{type: 'text-summary'},
{type: 'lcov'}
]
},
2015-12-12 22:45:57 +03:00
client: {
chai: {
truncateThreshold: 0
}
},
2015-12-10 00:46:27 +03:00
//load angular dependencies and browser polyfills
files: [
'node_modules/zone.js/dist/zone-microtask.js',
2015-12-19 18:17:54 +03:00
'node_modules/zone.js/dist/long-stack-trace-zone.js',
2015-12-21 22:35:12 +03:00
'node_modules/zone.js/dist/jasmine-patch.js',
2015-12-10 00:46:27 +03:00
'node_modules/babel-polyfill/dist/polyfill.js',
'node_modules/reflect-metadata/Reflect.js'
],
jspm: {
config: 'system.config.js',
2016-01-15 23:34:28 +03:00
loadFiles: ['tests/unit/*.spec.js', 'tests/helpers.js', 'lib/**/*.js'],
2015-12-19 01:53:33 +03:00
serveFiles: ['tests/schemas/**/*.json', 'lib/**/*.html', '.tmp/lib/**/*.css'],
2015-12-10 00:46:27 +03:00
nocache: true
},
proxies: {
'/tests/': '/base/tests/',
'/lib/': '/base/lib/',
'/jspm_packages/': '/base/jspm_packages/',
'/node_modules/': '/base/node_modules/',
2015-12-19 01:53:33 +03:00
'/.tmp/': '/base/.tmp/'
2015-12-10 00:46:27 +03:00
},
2015-12-13 13:37:58 +03:00
reporters: travis ? ['mocha', 'coverage', 'coveralls'] : ['mocha', 'coverage'],
2015-12-10 00:46:27 +03:00
browsers: ['PhantomJS'],
2015-12-10 00:46:27 +03:00
browserNoActivityTimeout: 60000
});
}