open-easyrtc
Version:
Open-EasyRTC enables quick development of WebRTC
151 lines (126 loc) • 4.41 kB
JavaScript
/*
Script: karma.conf.js
This file is part of EasyRTC.
*/
/*global
module
*/
module.exports = function (config) {
'use strict';
config.set({
frameworks: ['jasmine', 'requirejs'],
// base path, that will be used to resolve files and exclude
basePath: '../../',
// list of files / patterns to load in the browser
files: [
{
pattern: 'node_modules/socket.io-client/dist/socket.io.js',
included: false
},
{
pattern: 'node_modules/webrtc-adapter/out/adapter.js',
included: false
},
{
pattern: 'test/api/spec/**/*',
included: false
},
{
pattern: 'api/**/*',
included: false
},
// Run Karma require bootstrap
'test/api/bootstrap/karma.js'
],
// list of files to exclude
exclude: [],
preprocessors: {
'api/**/*.js': ['coverage']
},
// use dots reporter, as travis terminal does not support escaping sequences
// possible values: 'dots', 'progress'
// CLI --reporters progress
reporters: ['coverage', 'progress'],
coverageReporter: {
type: 'html',
dir: 'test/reports/test-api-coverage/'
},
// web server port
// CLI --port 9876
port: 9876,
// enable / disable colors in the output (reporters and logs)
// CLI --colors --no-colors
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
// CLI --log-level debug
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
// CLI --auto-watch --no-auto-watch
autoWatch: true,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
// CLI --browsers Chrome,Firefox,Safari
browsers: ['Chrome_without_security'],
customLaunchers: {
firefoxLauncher: {
base: 'Firefox',
prefs: {
'security.ssl.enable_ocsp_stapling': false
}
},
Chrome_without_security: {
base: 'Chrome',
flags: [
'--ignore-certificate-errors=true',
'--user-data-dir=./tmp',
'--allow-insecure-localhost',
'--allow-running-insecure-content',
'--use-fake-device-for-media-stream',
'--use-fake-ui-for-media-stream'
]
},
'ChromeHeadless': {
base: 'Chrome',
flags: [
'--headless',
'--disable-gpu',
'--no-sandbox',
'--disable-dev-shm-usage',
'--window-size=1280,1024',
'--ignore-certificate-errors=true',
'--allow-insecure-localhost',
'--allow-running-insecure-content',
'--use-fake-device-for-media-stream',
'--use-fake-ui-for-media-stream',
// Without a remote debugging port, Google Chrome exits immediately.
'--remote-debugging-port=9222'
],
debug: true
}
},
// If browser does not capture in given timeout [ms], kill it
// CLI --capture-timeout 5000
captureTimeout: 5000,
// Auto run tests on start (when browsers are captured) and exit
// CLI --single-run --no-single-run
singleRun: true,
// report which specs are slower than 500ms
// CLI --report-slower-than 500
reportSlowerThan: 500,
plugins: [
'karma-jasmine',
'karma-requirejs',
'karma-coverage',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-ie-launcher'
]
});
};