skipping steps should not mess with assertion number
THis was a mistake as `assertion` is clearly different from `steps`. `test.skip` does skip steps.
Showing
2 changed files
with
5 additions
and
6 deletions
... | @@ -241,7 +241,6 @@ Tester.prototype.skip = function skip(nb, message) { | ... | @@ -241,7 +241,6 @@ Tester.prototype.skip = function skip(nb, message) { |
241 | last = steps.length; | 241 | last = steps.length; |
242 | 242 | ||
243 | this.casper.step = Math.min(step + nb, last); | 243 | this.casper.step = Math.min(step + nb, last); |
244 | this.executed += this.casper.step - step; | ||
245 | 244 | ||
246 | return this.processAssertionResult({ | 245 | return this.processAssertionResult({ |
247 | success: null, | 246 | success: null, | ... | ... |
1 | /*global casper*/ | 1 | /*global casper*/ |
2 | /*jshint strict:false*/ | 2 | /*jshint strict:false*/ |
3 | casper.test.begin('Skip tests', 2, function(test) { | 3 | casper.test.begin('Skip tests', 1, function(test) { |
4 | casper.start('tests/site/index.html'); | 4 | casper.start('tests/site/index.html'); |
5 | 5 | ||
6 | casper. | 6 | casper. |
... | @@ -19,7 +19,7 @@ casper.test.begin('Skip tests', 2, function(test) { | ... | @@ -19,7 +19,7 @@ casper.test.begin('Skip tests', 2, function(test) { |
19 | }); | 19 | }); |
20 | }); | 20 | }); |
21 | 21 | ||
22 | casper.test.begin('Skip multiple', 3, function(test) { | 22 | casper.test.begin('Skip multiple', 1, function(test) { |
23 | casper. | 23 | casper. |
24 | then(function () { | 24 | then(function () { |
25 | test.skip(2); | 25 | test.skip(2); |
... | @@ -61,7 +61,7 @@ casper.test.begin('Skip does not polluate next suite', 1, function(test) { | ... | @@ -61,7 +61,7 @@ casper.test.begin('Skip does not polluate next suite', 1, function(test) { |
61 | }); | 61 | }); |
62 | }); | 62 | }); |
63 | 63 | ||
64 | casper.test.begin('Casper.thenSkip', 2, function(test) { | 64 | casper.test.begin('Casper.thenSkip', 1, function(test) { |
65 | casper. | 65 | casper. |
66 | thenSkip(1). | 66 | thenSkip(1). |
67 | then(function () { | 67 | then(function () { |
... | @@ -76,7 +76,7 @@ casper.test.begin('Casper.thenSkip', 2, function(test) { | ... | @@ -76,7 +76,7 @@ casper.test.begin('Casper.thenSkip', 2, function(test) { |
76 | }); | 76 | }); |
77 | }); | 77 | }); |
78 | 78 | ||
79 | casper.test.begin('Casper.thenSkipIf', 5, function(test) { | 79 | casper.test.begin('Casper.thenSkipIf', 3, function(test) { |
80 | casper. | 80 | casper. |
81 | thenSkipIf(true, 1, "Skip if with function"). | 81 | thenSkipIf(true, 1, "Skip if with function"). |
82 | then(function () { | 82 | then(function () { |
... | @@ -106,7 +106,7 @@ casper.test.begin('Casper.thenSkipIf', 5, function(test) { | ... | @@ -106,7 +106,7 @@ casper.test.begin('Casper.thenSkipIf', 5, function(test) { |
106 | }); | 106 | }); |
107 | }); | 107 | }); |
108 | 108 | ||
109 | casper.test.begin('Casper.thenSkipUnless', 5, function(test) { | 109 | casper.test.begin('Casper.thenSkipUnless', 3, function(test) { |
110 | casper. | 110 | casper. |
111 | thenSkipUnless(false, 1, "Skip unless with function"). | 111 | thenSkipUnless(false, 1, "Skip unless with function"). |
112 | then(function () { | 112 | then(function () { | ... | ... |
-
Please register or sign in to post a comment