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