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
31154e2b
...
31154e2b35460dbd2baab202458946dfd542d48e
authored
2011-12-26 19:01:32 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
updated Tester.renderResults() to fail if no test has been run
1 parent
260afc12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
modules/tester.js
modules/tester.js
View file @
31154e2
...
...
@@ -372,14 +372,20 @@ var Tester = function(casper, options) {
this
.
renderResults
=
function
(
exit
,
status
,
save
)
{
save
=
utils
.
isType
(
save
,
"string"
)
?
save
:
this
.
options
.
save
;
var
total
=
this
.
testResults
.
passed
+
this
.
testResults
.
failed
,
statusText
,
style
,
result
;
if
(
t
his
.
testResults
.
failed
>
0
)
{
if
(
t
otal
===
0
)
{
statusText
=
FAIL
;
style
=
'RED_BAR'
;
result
=
statusText
+
" Looks like you didn't run any test."
;
}
else
{
statusText
=
PASS
;
style
=
'GREEN_BAR'
;
if
(
this
.
testResults
.
failed
>
0
)
{
statusText
=
FAIL
;
style
=
'RED_BAR'
;
}
else
{
statusText
=
PASS
;
style
=
'GREEN_BAR'
;
}
result
=
statusText
+
' '
+
total
+
' tests executed, '
+
this
.
testResults
.
passed
+
' passed, '
+
this
.
testResults
.
failed
+
' failed.'
;
}
result
=
statusText
+
' '
+
total
+
' tests executed, '
+
this
.
testResults
.
passed
+
' passed, '
+
this
.
testResults
.
failed
+
' failed.'
;
casper
.
echo
(
this
.
colorize
(
utils
.
fillBlanks
(
result
),
style
));
if
(
save
&&
utils
.
isType
(
require
,
"function"
))
{
try
{
...
...
Please
register
or
sign in
to post a comment