moved test results rendering to assert.js
Showing
2 changed files
with
8 additions
and
4 deletions
... | @@ -29,5 +29,12 @@ phantom.Casper.extend({ | ... | @@ -29,5 +29,12 @@ phantom.Casper.extend({ |
29 | 29 | ||
30 | assertEvalEquals: function(fn, expected, message) { | 30 | assertEvalEquals: function(fn, expected, message) { |
31 | return this.assertEquals(this.evaluate(fn), expected, message); | 31 | return this.assertEquals(this.evaluate(fn), expected, message); |
32 | }, | ||
33 | |||
34 | renderResults: function() { | ||
35 | this.echo("=========================================="); | ||
36 | var total = testResults.passed + testResults.failed; | ||
37 | this.echo(total + ' tests executed, ' + testResults.passed + ' passed, ' + testResults.failed + ' failed.'); | ||
38 | this.exit(); | ||
32 | } | 39 | } |
33 | }); | 40 | }); |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -45,8 +45,5 @@ casper.then(function(self) { | ... | @@ -45,8 +45,5 @@ casper.then(function(self) { |
45 | }); | 45 | }); |
46 | 46 | ||
47 | casper.run(function(self) { | 47 | casper.run(function(self) { |
48 | self.echo("=========================================="); | 48 | self.renderResults(); |
49 | var total = testResults.passed + testResults.failed; | ||
50 | self.echo(total + ' tests executed, ' + testResults.passed + ' passed, ' + testResults.failed + ' failed.'); | ||
51 | self.exit(); | ||
52 | }); | 49 | }); | ... | ... |
-
Please register or sign in to post a comment