fixed setUp() & tearDown() test setup
Showing
2 changed files
with
6 additions
and
6 deletions
... | @@ -14,6 +14,9 @@ casper.test.tearDown(function(done) { | ... | @@ -14,6 +14,9 @@ casper.test.tearDown(function(done) { |
14 | setTimeout(function() { | 14 | setTimeout(function() { |
15 | tearDown = true; | 15 | tearDown = true; |
16 | done(); | 16 | done(); |
17 | // reset | ||
18 | casper.test.setUp(); | ||
19 | casper.test.tearDown(); | ||
17 | }, 50); | 20 | }, 50); |
18 | }); | 21 | }); |
19 | 22 | ||
... | @@ -24,8 +27,5 @@ casper.test.begin('setUp() tests', 1, function(test) { | ... | @@ -24,8 +27,5 @@ casper.test.begin('setUp() tests', 1, function(test) { |
24 | 27 | ||
25 | casper.test.begin('tearDown() tests', 1, function(test) { | 28 | casper.test.begin('tearDown() tests', 1, function(test) { |
26 | test.assertTrue(tearDown, 'Tester.tearDown() executed the async tear down function'); | 29 | test.assertTrue(tearDown, 'Tester.tearDown() executed the async tear down function'); |
27 | // reset | ||
28 | test.setUp(); | ||
29 | test.tearDown(); | ||
30 | test.done(); | 30 | test.done(); |
31 | }); | 31 | }); | ... | ... |
... | @@ -9,6 +9,9 @@ casper.test.setUp(function() { | ... | @@ -9,6 +9,9 @@ casper.test.setUp(function() { |
9 | 9 | ||
10 | casper.test.tearDown(function() { | 10 | casper.test.tearDown(function() { |
11 | tearDown = true; | 11 | tearDown = true; |
12 | // reset | ||
13 | casper.test.setUp(); | ||
14 | casper.test.tearDown(); | ||
12 | }); | 15 | }); |
13 | 16 | ||
14 | casper.test.begin('setUp() tests', 1, function(test) { | 17 | casper.test.begin('setUp() tests', 1, function(test) { |
... | @@ -18,8 +21,5 @@ casper.test.begin('setUp() tests', 1, function(test) { | ... | @@ -18,8 +21,5 @@ casper.test.begin('setUp() tests', 1, function(test) { |
18 | 21 | ||
19 | casper.test.begin('tearDown() tests', 1, function(test) { | 22 | casper.test.begin('tearDown() tests', 1, function(test) { |
20 | test.assertTrue(tearDown, 'Tester.tearDown() executed the tear down function'); | 23 | test.assertTrue(tearDown, 'Tester.tearDown() executed the tear down function'); |
21 | // reset | ||
22 | test.setUp(); | ||
23 | test.tearDown(); | ||
24 | test.done(); | 24 | test.done(); |
25 | }); | 25 | }); | ... | ... |
-
Please register or sign in to post a comment