Comparing version 0.0.4-alpha to 0.0.5-alpha
@@ -24,3 +24,3 @@ 'use strict'; | ||
this.passed = 0; | ||
this.total = task.tests.length; | ||
this.testCount = task.tests.length; | ||
this.reportQueue = Reporter._createReportQueue(task); | ||
@@ -105,3 +105,3 @@ | ||
_this.plugin.reportTaskStart(startTime, userAgents); | ||
_this.plugin.reportTaskStart(startTime, userAgents, _this.testCount); | ||
_this.plugin.reportFixtureStart(first.fixtureName, first.fixturePath); | ||
@@ -138,3 +138,3 @@ }); | ||
_this.plugin.reportTaskDone(endTime, _this.passed, _this.total); | ||
_this.plugin.reportTaskDone(endTime, _this.passed); | ||
}); | ||
@@ -141,0 +141,0 @@ }; |
@@ -180,3 +180,3 @@ 'use strict'; | ||
ReporterPluginHost.prototype.reportTaskStart = function reportTaskStart(startTime, userAgents) { | ||
ReporterPluginHost.prototype.reportTaskStart = function reportTaskStart(startTime, userAgents, testCount) { | ||
throw new Error('Not implemented'); | ||
@@ -193,3 +193,3 @@ }; | ||
ReporterPluginHost.prototype.reportTaskDone = function reportTaskDone(endTime, passed, total) { | ||
ReporterPluginHost.prototype.reportTaskDone = function reportTaskDone(endTime, passed) { | ||
throw new Error('Not implemented'); | ||
@@ -196,0 +196,0 @@ }; |
@@ -15,9 +15,10 @@ "use strict"; | ||
passed: 0, | ||
total: 0, | ||
testCount: 0, | ||
fixtures: [] | ||
}, | ||
reportTaskStart: function (startTime, userAgents) { | ||
reportTaskStart: function (startTime, userAgents, testCount) { | ||
this.report.startTime = startTime; | ||
this.report.userAgents = userAgents; | ||
this.report.testCount = testCount; | ||
}, | ||
@@ -40,5 +41,4 @@ | ||
reportTaskDone: function (endTime, passed, total) { | ||
reportTaskDone: function (endTime, passed) { | ||
this.report.passed = passed; | ||
this.report.total = total; | ||
this.report.endTime = endTime; | ||
@@ -45,0 +45,0 @@ |
@@ -11,4 +11,5 @@ 'use strict'; | ||
currentFixtureName: null, | ||
testCount: 0, | ||
reportTaskStart: function (startTime, userAgents) { | ||
reportTaskStart: function (startTime, userAgents, testCount) { | ||
var _this = this; | ||
@@ -21,2 +22,3 @@ | ||
this.startTime = startTime; | ||
this.testCount = testCount; | ||
@@ -60,6 +62,6 @@ this.setIndent(0).useWordWrap(true).write(this.chalk.bold('Running tests in: ' + uaList)).newline().newline(); | ||
reportTaskDone: function (endTime, passed, total) { | ||
reportTaskDone: function (endTime, passed) { | ||
var durationMs = endTime - this.startTime; | ||
var durationStr = this.moment.duration(durationMs).format('h[h] mm[m] ss[s]'); | ||
var footer = passed === total ? this.chalk.bold.green(total + ' passed') : this.chalk.bold.red(total - passed + '/' + total + ' failed'); | ||
var footer = passed === this.testCount ? this.chalk.bold.green(this.testCount + ' passed') : this.chalk.bold.red(this.testCount - passed + '/' + this.testCount + ' failed'); | ||
@@ -66,0 +68,0 @@ footer += this.chalk.gray(' (' + durationStr + ')'); |
@@ -12,5 +12,6 @@ 'use strict'; | ||
currentFixtureName: null, | ||
testCount: 0, | ||
reportTaskStart: function () { | ||
// NOTE: do nothing | ||
reportTaskStart: function (startTime, userAgents, testCount) { | ||
this.testCount = testCount; | ||
}, | ||
@@ -46,7 +47,7 @@ | ||
reportTaskDone: function (endTime, passed, total) { | ||
reportTaskDone: function (endTime, passed) { | ||
var _this2 = this; | ||
var allPassed = !this.errDescriptors.length; | ||
var footer = allPassed ? this.chalk.bold.green(total + ' passed') : this.chalk.bold.red(total - passed + '/' + total + ' failed'); | ||
var footer = allPassed ? this.chalk.bold.green(this.testCount + ' passed') : this.chalk.bold.red(this.testCount - passed + '/' + this.testCount + ' failed'); | ||
@@ -53,0 +54,0 @@ this.setIndent(2).newline().newline().write(footer).newline(); |
@@ -10,4 +10,5 @@ 'use strict'; | ||
afterErrList: false, | ||
testCount: 0, | ||
reportTaskStart: function (startTime, userAgents) { | ||
reportTaskStart: function (startTime, userAgents, testCount) { | ||
var _this = this; | ||
@@ -20,2 +21,3 @@ | ||
this.startTime = startTime; | ||
this.testCount = testCount; | ||
@@ -64,6 +66,6 @@ this.setIndent(0).useWordWrap(true).write(this.chalk.bold('Running tests in: ' + uaList)).newline(); | ||
reportTaskDone: function (endTime, passed, total) { | ||
reportTaskDone: function (endTime, passed) { | ||
var durationMs = endTime - this.startTime; | ||
var durationStr = this.moment.duration(durationMs).format('h[h] mm[m] ss[s]'); | ||
var footer = passed === total ? this.chalk.bold.green(total + ' passed') : this.chalk.bold.red(total - passed + '/' + total + ' failed'); | ||
var footer = passed === this.testCount ? this.chalk.bold.green(this.testCount + ' passed') : this.chalk.bold.red(this.testCount - passed + '/' + this.testCount + ' failed'); | ||
@@ -70,0 +72,0 @@ footer += this.chalk.gray(' (' + durationStr + ')'); |
@@ -13,6 +13,8 @@ 'use strict'; | ||
currentFixtureName: null, | ||
testCount: 0, | ||
reportTaskStart: function (startTime, userAgents) { | ||
reportTaskStart: function (startTime, userAgents, testCount) { | ||
this.startTime = startTime; | ||
this.uaList = userAgents.join(', '); | ||
this.testCount = testCount; | ||
}, | ||
@@ -58,8 +60,8 @@ | ||
reportTaskDone: function (endTime, passed, total) { | ||
reportTaskDone: function (endTime, passed) { | ||
var name = 'TestCafe Tests: ' + this.escapeHtml(this.uaList); | ||
var failures = total - passed; | ||
var failures = this.testCount - passed; | ||
var time = (endTime - this.startTime) / 1000; | ||
this.write('<?xml version="1.0" encoding="UTF-8" ?>').newline().write('<testsuite name="' + name + '" tests="' + total + '" failures="' + failures + '" ' + ('errors="' + failures + '" time="' + time + '" timestamp="' + endTime.toUTCString() + '" >')).newline().write(this.report).write('</testsuite>'); | ||
this.write('<?xml version="1.0" encoding="UTF-8" ?>').newline().write('<testsuite name="' + name + '" tests="' + this.testCount + '" failures="' + failures + '" ' + ('errors="' + failures + '" time="' + time + '" timestamp="' + endTime.toUTCString() + '" >')).newline().write(this.report).write('</testsuite>'); | ||
} | ||
@@ -66,0 +68,0 @@ }; |
@@ -148,3 +148,3 @@ 'use strict'; | ||
resolve(reporter.total - reporter.passed); | ||
resolve(reporter.testCount - reporter.passed); | ||
@@ -151,0 +151,0 @@ case 3: |
{ | ||
"name": "testcafe", | ||
"version": "0.0.4-alpha", | ||
"version": "0.0.5-alpha", | ||
"main": "lib/index", | ||
@@ -5,0 +5,0 @@ "bin": { |
769429
7068