Commit 2f1993f1 2f1993f1132fdaa87129db9780d34a07b34dd61e by Nicolas Perriault

fixed broken `--fail-fast` option creating an endless loop on error

1 parent f7a3d5a7
......@@ -4,6 +4,7 @@ CasperJS Changelog
XXXX-XX-XX, v1.0.0
------------------
- fixed [#215](https://github.com/n1k0/casperjs/issues/215) - fixed broken `--fail-fast` option creating an endless loop on error
- fixed `Tester.renderFailureDetails()` which couldn't print failure details correctly in certain circumstances
- fixed `Casper.getHTML()` wasn't retrieving active frame contents when using `Casper.withFrame()`
- merged PR [#322](https://github.com/n1k0/casperjs/pull/322) - Support number in `Casper.withFrame()`
......
......@@ -158,7 +158,7 @@ var Casper = function Casper(options) {
this.on('error', function(msg, backtrace) {
if (msg === this.test.SKIP_MESSAGE) {
return this.warn(f('--fail-fast: aborted remaining tests in "%s"', this.test.currentTestFile));
return;
}
var c = this.getColorizer();
var match = /^(.*): __mod_error(.*):: (.*)/.exec(msg);
......
......@@ -141,8 +141,13 @@ 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();
}
var line = 0;
if (!utils.isString(msg) && msg.indexOf(this.SKIP_MESSAGE) === -1) {
if (!utils.isString(msg)) {
try {
line = backtrace[0].line;
} catch (e) {}
......@@ -152,7 +157,9 @@ var Tester = function Tester(casper, options) {
});
this.casper.on('step.error', function onStepError(e) {
if (e.message !== this.test.SKIP_MESSAGE) {
this.test.uncaughtError(e, this.test.currentTestFile);
}
this.test.done();
});
};
......