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
eb98da17
...
eb98da17607a04499bf8ba806db85dd702bd8b8d
authored
2012-12-19 17:16:01 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
refs #215 - attempting to fix `--fail-fast` again
1 parent
2f1993f1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
modules/tester.js
modules/tester.js
View file @
eb98da1
...
...
@@ -48,16 +48,19 @@ exports.create = function create(casper, options) {
*/
var
Tester
=
function
Tester
(
casper
,
options
)
{
"use strict"
;
/*jshint maxstatements:
2
0*/
/*jshint maxstatements:
3
0*/
if
(
!
utils
.
isCasperObject
(
casper
))
{
throw
new
CasperError
(
"Tester needs a Casper instance"
);
}
var
self
=
this
;
this
.
casper
=
casper
;
this
.
SKIP_MESSAGE
=
'__termination__'
;
this
.
aborted
=
false
;
this
.
executed
=
0
;
this
.
currentTestFile
=
null
;
this
.
currentSuiteNum
=
0
;
...
...
@@ -141,10 +144,10 @@ var Tester = function Tester(casper, options) {
if
(
!
phantom
.
casperTest
)
{
return
;
}
if
(
msg
===
this
.
test
.
SKIP_MESSAGE
)
{
this
.
warn
(
f
(
'--fail-fast: aborted remaining tests in "%s"'
,
this
.
test
.
currentTestFile
));
this
.
test
.
currentSuiteNum
++
;
return
this
.
test
.
done
();
if
(
msg
===
self
.
SKIP_MESSAGE
)
{
this
.
warn
(
f
(
'--fail-fast: aborted remaining tests in "%s"'
,
self
.
currentTestFile
));
self
.
aborted
=
true
;
return
self
.
done
();
}
var
line
=
0
;
if
(
!
utils
.
isString
(
msg
))
{
...
...
@@ -152,15 +155,15 @@ var Tester = function Tester(casper, options) {
line
=
backtrace
[
0
].
line
;
}
catch
(
e
)
{}
}
this
.
test
.
uncaughtError
(
msg
,
this
.
test
.
currentTestFile
,
line
);
this
.
test
.
done
();
self
.
uncaughtError
(
msg
,
self
.
currentTestFile
,
line
);
self
.
done
();
});
this
.
casper
.
on
(
'step.error'
,
function
onStepError
(
e
)
{
if
(
e
.
message
!==
this
.
test
.
SKIP_MESSAGE
)
{
this
.
test
.
uncaughtError
(
e
,
this
.
test
.
currentTestFile
);
if
(
e
.
message
!==
self
.
SKIP_MESSAGE
)
{
self
.
uncaughtError
(
e
,
self
.
currentTestFile
);
}
this
.
test
.
done
();
self
.
done
();
});
};
...
...
@@ -1076,10 +1079,11 @@ Tester.prototype.runSuites = function runSuites() {
if
(
self
.
running
)
{
return
;
}
if
(
self
.
currentSuiteNum
===
testFiles
.
length
)
{
if
(
self
.
currentSuiteNum
===
testFiles
.
length
||
self
.
aborted
)
{
self
.
emit
(
'tests.complete'
);
clearInterval
(
interval
);
self
.
exporter
.
setSuiteDuration
(
self
.
calculateSuiteDuration
());
self
.
aborted
=
false
;
}
else
{
self
.
runTest
(
testFiles
[
self
.
currentSuiteNum
]);
self
.
exporter
.
setSuiteDuration
(
self
.
calculateSuiteDuration
());
...
...
Please
register
or
sign in
to post a comment