tellform/karma.conf.js

81 lines
2 KiB
JavaScript
Raw Normal View History

2015-06-29 22:51:29 +00:00
'use strict';
/**
* Module dependencies.
*/
2015-08-19 22:29:01 +00:00
var applicationConfiguration = require('./config/config'),
bowerFiles = require('main-bower-files');
var bowerDep = bowerFiles('**/**.js');
2015-07-27 18:11:43 +00:00
2015-06-29 22:51:29 +00:00
// Karma configuration
module.exports = function(config) {
2015-12-12 20:08:48 +00:00
var shouldBeSingleRun = false
if(process.env.NODE_ENV === 'travis') shouldBeSingleRun = true
2015-06-29 22:51:29 +00:00
config.set({
// Frameworks to use
frameworks: ['jasmine'],
// List of files / patterns to load in the browser
files: bowerDep.concat(applicationConfiguration.assets.js, applicationConfiguration.assets.unit_tests, applicationConfiguration.assets.views),
2015-06-29 22:51:29 +00:00
// Test results reporter to use
// Possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
2015-08-18 21:44:36 +00:00
reporters: ['mocha', 'html', 'progress'],
2015-06-29 22:51:29 +00:00
2015-11-23 19:19:02 +00:00
2015-08-21 00:17:14 +00:00
preprocessors: {
2015-11-23 19:19:02 +00:00
'public/modules/*/views/**/**.html': ['ng-html2js'],
'public/modules/*/views/*.html': ['ng-html2js'],
2015-11-23 19:19:02 +00:00
//'public/modules/*/*.js': ['coverage'],
//'public/modules/*/*[!tests]*/*.js': ['coverage'],
2015-08-21 00:17:14 +00:00
},
ngHtml2JsPreprocessor: {
stripPrefix: 'public/',
// the name of the Angular module to create
moduleName: 'module-templates'
},
2015-06-29 22:51:29 +00:00
// Web server port
port: 9876,
// Enable / disable colors in the output (reporters and logs)
colors: true,
2015-08-19 22:29:01 +00:00
//Make sure we capture console.log output
client: {
2015-11-23 19:19:02 +00:00
captureConsole: true,
mocha: {
bail: true
}
2015-08-19 22:29:01 +00:00
},
2015-06-29 22:51:29 +00:00
// Level of logging
// Possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// Enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
2015-07-27 18:11:43 +00:00
browsers: ['PhantomJS'],
2015-06-29 22:51:29 +00:00
// If browser does not capture in given timeout [ms], kill it
2015-11-23 19:19:02 +00:00
captureTimeout: 3000,
2015-06-29 22:51:29 +00:00
// Continuous Integration mode
// If true, it capture browsers, run tests and exit
2015-12-12 20:08:48 +00:00
singleRun: shouldBeSingleRun
2015-06-29 22:51:29 +00:00
});
};