src/cm/scripts/test-suite/karma.conf.js
author Simon Descarpentries <sid@sopinspace.com>
Thu, 13 Feb 2014 18:54:19 +0100
changeset 575 8ce80860c3fe
child 578 1793daa8df8a
permissions -rw-r--r--
Add the skeleton of the future comt test-suite
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
575
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     1
// Karma configuration
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     2
// Generated on Wed Jan 29 2014 15:32:16 GMT+0100 (CET)
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     3
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     4
// SID: get WORKSPACE_URL configuration from one single file to customize
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     5
var w = require ('./workspace.info.js');
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     6
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     7
module.exports = function(config) {
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     8
	config.set({
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
     9
		// list of files or patterns to load in the browser, from current directory
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    10
		files: [
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    11
			{pattern: 'tests/**/*.js', included: true}
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    12
		],
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    13
		// list of files to exclude
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    14
		exclude: [
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    15
		],
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    16
		// Start these browsers, currently available:
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    17
		// - Firefox	; Safari	(only Mac; run `npm install karma-safari-launcher` first)
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    18
		// - Chrome		; ChromeCanary ; Opera (run `npm install karma-opera-launcher` first)
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    19
		// - PhantomJS	; IE		(only Windows; run `npm install karma-ie-launcher` first)
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    20
		browsers: ['Chrome'],
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    21
		// frameworks to use. SID: choosen mocha, added karma-e2e-dsl (end-to-end testing)
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    22
		frameworks: ['mocha', 'karma-e2e-dsl'],
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    23
		// SID: Karma will start and run somewhere else than '/', to allow proxying '/'
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    24
		urlRoot: '/karma/',
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    25
		// SID: directive added on karma-e2e-dsl purpose. Map of path-proxy pairs.
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    26
		proxies: {
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    27
			'/': w.WORKSPACE_URL
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    28
		},
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    29
		client: {
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    30
			args:[w.WORKSPACE_NAME, w.USER_ADMIN, w.PASS_ADMIN], 
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    31
			// captureConsole: false
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    32
		},
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    33
		// test results reporter to use : 'dots', 'progress', 'junit', 'growl', 'coverage'
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    34
		reporters: ['progress'],
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    35
		// web server port
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    36
		port: 9876,
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    37
		// enable / disable colors in the output (reporters and logs)
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    38
		colors: true,
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    39
		// level of logging : config.LOG_DISABLE || _ERROR || _WARN || _INFO || _DEBUG
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    40
		logLevel: config.LOG_INFO || config.LOG_DEBUG,
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    41
		// enable / disable watching file and executing tests whenever any file changes
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    42
		autoWatch: false,
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    43
		// If browser does not capture in given timeout [ms], kill it
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    44
		captureTimeout: 20000,
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    45
		// Continuous Integration mode : if true, it capture browsers, run tests and exit
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    46
		// singleRun: false
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    47
		singleRun: true,
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    48
	});
8ce80860c3fe Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff changeset
    49
};