dev/modules/sysconfig/files/karma.conf.full.js
changeset 628 ecf0e467eeb8
parent 609 736fdedb7774
child 630 36ef50b63372
--- a/dev/modules/sysconfig/files/karma.conf.full.js	Mon Apr 07 17:41:35 2014 +0200
+++ b/dev/modules/sysconfig/files/karma.conf.full.js	Tue Apr 08 16:21:53 2014 +0200
@@ -3,7 +3,8 @@
 
 
 // SID: get WORKSPACE_URL configuration from one single file to customize
-var w = require ('./workspace.info.full.js');
+var w = require ('./workspace.info.full.js'),
+	t = require ('./lib/test_hlp.js');
 
 module.exports = function(config) {
 	config.set({
@@ -31,7 +32,12 @@
 			mocha: {
 				ui: 'tdd'
 			},
-			w: w // SID: exports the variable in the test execution browser window
+			w: w, // SID: exports the variable in the test execution browser window
+			// SID: we can't pass living functions to testing (mocha) browser environment
+			// so we convert them to string, and send also a string body of a reviving function
+			// closures are lost in the process, that's ok.
+			t: JSON.stringify (t, function (k, v) { return typeof v === 'function' ? v.toString () : v }),
+			r: t.reviveFunc
 		},
 		// test results reporter to use : 'dots', 'progress', 'junit', 'growl', 'coverage'
 		reporters: ['progress'],
@@ -40,13 +46,12 @@
 		// enable / disable colors in the output (reporters and logs)
 		colors: true,
 		// level of logging : config.LOG_DISABLE || _ERROR || _WARN || _INFO || _DEBUG
-		logLevel: config.LOG_INFO || config.LOG_DEBUG,
+		logLevel: config.LOG_INFO,
+		// If browser does not capture in given timeout [ms], kill it
+		captureTimeout: 9999,
 		// enable / disable watching file and executing tests whenever any file changes
 		autoWatch: false,
-		// If browser does not capture in given timeout [ms], kill it
-		captureTimeout: 20000,
 		// Continuous Integration mode : if true, it capture browsers, run tests and exit
-		// singleRun: false
 		singleRun: true,
 	});
 };