Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
ea90cda7
...
ea90cda71c181973654c269be9e1f73684303305
authored
2013-03-06 20:16:07 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
don't count dubious tests in final fail count
1 parent
a7bb0889
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
4 deletions
modules/tester.js
modules/tester.js
View file @
ea90cda
...
...
@@ -1237,9 +1237,10 @@ Tester.prototype.renderResults = function renderResults(exit, status, save) {
"use strict"
;
/*jshint maxstatements:20*/
save
=
save
||
this
.
options
.
save
;
var
failed
=
this
.
suiteResults
.
countFailed
(),
var
dubious
=
this
.
suiteResults
.
countDubious
(),
failed
=
this
.
suiteResults
.
countFailed
(),
passed
=
this
.
suiteResults
.
countPassed
(),
total
=
this
.
suiteResults
.
count
Total
(),
total
=
this
.
suiteResults
.
count
Executed
(),
statusText
,
style
,
result
,
...
...
@@ -1256,12 +1257,13 @@ Tester.prototype.renderResults = function renderResults(exit, status, save) {
statusText
=
this
.
options
.
passText
;
style
=
'GREEN_BAR'
;
}
result
=
f
(
'%s %s tests executed in %ss, %d passed, %d failed.'
,
result
=
f
(
'%s %s tests executed in %ss, %d passed, %d failed
%s
.'
,
statusText
,
total
,
utils
.
ms2seconds
(
this
.
suiteResults
.
calculateDuration
()),
passed
,
failed
);
failed
,
dubious
?
f
(
' (%d dubious)'
,
dubious
)
:
''
);
}
this
.
casper
.
echo
(
result
,
style
,
this
.
options
.
pad
);
if
(
failed
>
0
)
{
...
...
@@ -1426,6 +1428,30 @@ TestSuiteResult.prototype.countTotal = function countTotal() {
};
/**
* Returns the number of dubious results.
*
* @return Number
*/
TestSuiteResult
.
prototype
.
countDubious
=
function
countDubious
()
{
"use strict"
;
return
this
.
map
(
function
(
result
)
{
return
result
.
dubious
;
}).
reduce
(
function
(
a
,
b
)
{
return
a
+
b
;
},
0
);
};
/**
* Returns the number of executed tests.
*
* @return Number
*/
TestSuiteResult
.
prototype
.
countExecuted
=
function
countTotal
()
{
"use strict"
;
return
this
.
countTotal
()
-
this
.
countDubious
();
};
/**
* Returns the number of errors.
*
* @return Number
...
...
@@ -1568,6 +1594,11 @@ function TestCaseResult(options) {
this
.
__defineGetter__
(
"failed"
,
function
()
{
return
this
.
failures
.
length
;
});
this
.
__defineGetter__
(
"dubious"
,
function
()
{
return
this
.
failures
.
filter
(
function
(
failure
)
{
return
failure
.
type
===
"dubious"
;
}).
length
;
});
this
.
__defineGetter__
(
"passed"
,
function
()
{
return
this
.
passes
.
length
;
});
...
...
Please
register
or
sign in
to post a comment