fixed broken `--fail-fast` option creating an endless loop on error
Showing
3 changed files
with
11 additions
and
3 deletions
... | @@ -4,6 +4,7 @@ CasperJS Changelog | ... | @@ -4,6 +4,7 @@ CasperJS Changelog |
4 | XXXX-XX-XX, v1.0.0 | 4 | XXXX-XX-XX, v1.0.0 |
5 | ------------------ | 5 | ------------------ |
6 | 6 | ||
7 | - fixed [#215](https://github.com/n1k0/casperjs/issues/215) - fixed broken `--fail-fast` option creating an endless loop on error | ||
7 | - fixed `Tester.renderFailureDetails()` which couldn't print failure details correctly in certain circumstances | 8 | - fixed `Tester.renderFailureDetails()` which couldn't print failure details correctly in certain circumstances |
8 | - fixed `Casper.getHTML()` wasn't retrieving active frame contents when using `Casper.withFrame()` | 9 | - fixed `Casper.getHTML()` wasn't retrieving active frame contents when using `Casper.withFrame()` |
9 | - merged PR [#322](https://github.com/n1k0/casperjs/pull/322) - Support number in `Casper.withFrame()` | 10 | - merged PR [#322](https://github.com/n1k0/casperjs/pull/322) - Support number in `Casper.withFrame()` | ... | ... |
... | @@ -158,7 +158,7 @@ var Casper = function Casper(options) { | ... | @@ -158,7 +158,7 @@ var Casper = function Casper(options) { |
158 | 158 | ||
159 | this.on('error', function(msg, backtrace) { | 159 | this.on('error', function(msg, backtrace) { |
160 | if (msg === this.test.SKIP_MESSAGE) { | 160 | if (msg === this.test.SKIP_MESSAGE) { |
161 | return this.warn(f('--fail-fast: aborted remaining tests in "%s"', this.test.currentTestFile)); | 161 | return; |
162 | } | 162 | } |
163 | var c = this.getColorizer(); | 163 | var c = this.getColorizer(); |
164 | var match = /^(.*): __mod_error(.*):: (.*)/.exec(msg); | 164 | var match = /^(.*): __mod_error(.*):: (.*)/.exec(msg); | ... | ... |
... | @@ -141,8 +141,13 @@ var Tester = function Tester(casper, options) { | ... | @@ -141,8 +141,13 @@ var Tester = function Tester(casper, options) { |
141 | if (!phantom.casperTest) { | 141 | if (!phantom.casperTest) { |
142 | return; | 142 | return; |
143 | } | 143 | } |
144 | if (msg === this.test.SKIP_MESSAGE) { | ||
145 | this.warn(f('--fail-fast: aborted remaining tests in "%s"', this.test.currentTestFile)); | ||
146 | this.test.currentSuiteNum++; | ||
147 | return this.test.done(); | ||
148 | } | ||
144 | var line = 0; | 149 | var line = 0; |
145 | if (!utils.isString(msg) && msg.indexOf(this.SKIP_MESSAGE) === -1) { | 150 | if (!utils.isString(msg)) { |
146 | try { | 151 | try { |
147 | line = backtrace[0].line; | 152 | line = backtrace[0].line; |
148 | } catch (e) {} | 153 | } catch (e) {} |
... | @@ -152,7 +157,9 @@ var Tester = function Tester(casper, options) { | ... | @@ -152,7 +157,9 @@ var Tester = function Tester(casper, options) { |
152 | }); | 157 | }); |
153 | 158 | ||
154 | this.casper.on('step.error', function onStepError(e) { | 159 | this.casper.on('step.error', function onStepError(e) { |
155 | this.test.uncaughtError(e, this.test.currentTestFile); | 160 | if (e.message !== this.test.SKIP_MESSAGE) { |
161 | this.test.uncaughtError(e, this.test.currentTestFile); | ||
162 | } | ||
156 | this.test.done(); | 163 | this.test.done(); |
157 | }); | 164 | }); |
158 | }; | 165 | }; | ... | ... |
-
Please register or sign in to post a comment