redoc/karma.conf.js

82 lines
2.7 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.js',
2016-04-30 00:45:53 +03:00
'node_modules/zone.js/dist/fake-async-test.js',
'node_modules/zone.js/dist/async-test.js',
2015-12-21 22:35:12 +03:00
'node_modules/zone.js/dist/jasmine-patch.js',
'node_modules/zone.js/dist/long-stack-trace-zone.js',
2015-12-10 00:46:27 +03:00
'node_modules/babel-polyfill/dist/polyfill.js',
'./node_modules/reflect-metadata/Reflect.js'
2015-12-10 00:46:27 +03:00
],
jspm: {
config: 'system.config.js',
loadFiles: ['tests/setup.js', 'tests/helpers.js', 'tests/unit/*.spec.js', 'lib/**/*.js'],
serveFiles: ['tests/schemas/**/*.json','tests/schemas/**/*.yml', 'lib/**/*.html',
'.tmp/lib/**/*.json', '.tmp/*js', '.tmp/lib/**/*.css'],
2015-12-10 00:46:27 +03:00
nocache: true
},
proxies: {
'/tests/': '/base/tests/',
2016-05-20 19:31:30 +03:00
'/lib/components/Redoc/redoc-initial-styles.css': '/base/.tmp/lib/components/Redoc/redoc-initial-styles.css',
'/lib/version.json': '/base/.tmp/lib/version.json',
2015-12-10 00:46:27 +03:00
'/lib/': '/base/lib/',
'/jspm_packages/': '/base/jspm_packages/',
'/node_modules/': '/base/node_modules/',
2016-04-28 22:40:57 +03:00
'/prismjs-bundle.js': '/base/.tmp/prismjs-bundle.js',
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
});
}