lib/teamcityBrowser.js
function teamcity(runner) {
	Base.call(this, runner);
	var stats = this.stats;
	var flowId = document.title || new Date().getTime();

	runner.on('suite', function (suite) {
		if (suite.root) return;
		suite.startDate = new Date();
		log('##teamcity[testSuiteStarted name=\'' + escape(suite.title) + '\' flowId=\'' + flowId + '\']');
	});

	runner.on('test', function (test) {
		log('##teamcity[testStarted name=\'' + escape(test.title) + '\' flowId=\'' + flowId + '\'  captureStandardOutput=\'true\']');
	});

	runner.on('fail', function (test, err) {
		log('##teamcity[testFailed name=\'' + escape(test.title) + '\' flowId=\'' + flowId + '\' message=\'' + escape(err.message) + '\' captureStandardOutput=\'true\' details=\'' + escape(err.stack) + '\']');
	});

	runner.on('pending', function (test) {
		log('##teamcity[testIgnored name=\'' + escape(test.title) + '\' flowId=\'' + flowId + '\' message=\'pending\']');
	});

	runner.on('test end', function (test) {
		log('##teamcity[testFinished name=\'' + escape(test.title) + '\' flowId=\'' + flowId + '\' duration=\'' + test.duration + '\']');
	});

	runner.on('suite end', function (suite) {
		if (suite.root) return;
		log('##teamcity[testSuiteFinished name=\'' + escape(suite.title) + '\' duration=\'' + (new Date() - suite.startDate) + '\' flowId=\'' + flowId + '\']');
	});

	runner.on('end', function () {
		log('##teamcity[testSuiteFinished name=\'mocha.suite\' duration=\'' + stats.duration + '\' flowId=\'' + flowId + '\']');
	});
}
function teamcity(runner) {
	Base.call(this, runner);
	var stats = this.stats;
	var flowId = document.title || new Date().getTime();

	runner.on('suite', function (suite) {
		if (suite.root) return;
		suite.startDate = new Date();
		log('##teamcity[testSuiteStarted name=\'' + escape(suite.title) + '\' flowId=\'' + flowId + '\']');
	});

	runner.on('test', function (test) {
		log('##teamcity[testStarted name=\'' + escape(test.title) + '\' flowId=\'' + flowId + '\'  captureStandardOutput=\'true\']');
	});

	runner.on('fail', function (test, err) {
		log('##teamcity[testFailed name=\'' + escape(test.title) + '\' flowId=\'' + flowId + '\' message=\'' + escape(err.message) + '\' captureStandardOutput=\'true\' details=\'' + escape(err.stack) + '\']');
	});

	runner.on('pending', function (test) {
		log('##teamcity[testIgnored name=\'' + escape(test.title) + '\' flowId=\'' + flowId + '\' message=\'pending\']');
	});

	runner.on('test end', function (test) {
		log('##teamcity[testFinished name=\'' + escape(test.title) + '\' flowId=\'' + flowId + '\' duration=\'' + test.duration + '\']');
	});

	runner.on('suite end', function (suite) {
		if (suite.root) return;
		log('##teamcity[testSuiteFinished name=\'' + escape(suite.title) + '\' duration=\'' + (new Date() - suite.startDate) + '\' flowId=\'' + flowId + '\']');
	});

	runner.on('end', function () {
		log('##teamcity[testSuiteFinished name=\'mocha.suite\' duration=\'' + stats.duration + '\' flowId=\'' + flowId + '\']');
	});
}
function teamcity ( runner ) { Base . call ( this , runner ) ; var stats = this . stats ; var flowId = document . title || new Date ( ) . getTime ( ) ; runner . on ( 'suite' , function ( suite ) { if ( suite . root ) return ; suite . startDate = new Date ( ) ; log ( '##teamcity[testSuiteStarted name=\'' + escape ( suite . title ) + '\' flowId=\'' + flowId + '\']' ) ; } ) ; runner . on ( 'test' , function ( test ) { log ( '##teamcity[testStarted name=\'' + escape ( test . title ) + '\' flowId=\'' + flowId + '\'  captureStandardOutput=\'true\']' ) ; } ) ; runner . on ( 'fail' , function ( test , err ) { log ( '##teamcity[testFailed name=\'' + escape ( test . title ) + '\' flowId=\'' + flowId + '\' message=\'' + escape ( err . message ) + '\' captureStandardOutput=\'true\' details=\'' + escape ( err . stack ) + '\']' ) ; } ) ; runner . on ( 'pending' , function ( test ) { log ( '##teamcity[testIgnored name=\'' + escape ( test . title ) + '\' flowId=\'' + flowId + '\' message=\'pending\']' ) ; } ) ; runner . on ( 'test end' , function ( test ) { log ( '##teamcity[testFinished name=\'' + escape ( test . title ) + '\' flowId=\'' + flowId + '\' duration=\'' + test . duration + '\']' ) ; } ) ; runner . on ( 'suite end' , function ( suite ) { if ( suite . root ) return ; log ( '##teamcity[testSuiteFinished name=\'' + escape ( suite . title ) + '\' duration=\'' + ( new Date ( ) - suite . startDate ) + '\' flowId=\'' + flowId + '\']' ) ; } ) ; runner . on ( 'end' , function ( ) { log ( '##teamcity[testSuiteFinished name=\'mocha.suite\' duration=\'' + stats . duration + '\' flowId=\'' + flowId + '\']' ) ; } ) ; }
Initialize a new `Teamcity` reporter for the browser.

@param {Runner} runner
@param {options} options
@api public
Initialize a new Teamcity reporter for the browser .