Commit 5d9f0ea0 5d9f0ea02d8641d059b484ec7a216fa6fbbaffd5 by Nathan Black

Add cli test for step throwing exception. Unfortuately there's another bug now r…

…eporting extra test failures
1 parent 729acab7
...@@ -269,6 +269,24 @@ class TestCommandOutputTest(CasperExecTestBase): ...@@ -269,6 +269,24 @@ class TestCommandOutputTest(CasperExecTestBase):
269 ], failing=True) 269 ], failing=True)
270 270
271 @timeout(20) 271 @timeout(20)
272 def test_step_throwing_test(self):
273 # using begin()
274 script_path = os.path.join(TEST_ROOT, 'tester', 'step_throws.js')
275 self.assertCommandOutputContains('test ' + script_path, [
276 script_path,
277 '# step throws',
278 'FAIL Error: oops!',
279 '# type: error',
280 '# file: %s:5' % script_path,
281 '# error: oops!',
282 'FAIL 2 tests executed', # this is another bug
283 '0 passed',
284 '2 failed',
285 '0 dubious',
286 '0 skipped',
287 ], failing=True)
288
289 @timeout(20)
272 def test_dubious_test(self): 290 def test_dubious_test(self):
273 script_path = os.path.join(TEST_ROOT, 'tester', 'dubious.js') 291 script_path = os.path.join(TEST_ROOT, 'tester', 'dubious.js')
274 self.assertCommandOutputContains('test ' + script_path, [ 292 self.assertCommandOutputContains('test ' + script_path, [
......
1 /*jshint strict:false*/
2 casper.test.begin('step throws', 1, function(test) {
3 casper.start();
4 casper.then(function() {
5 throw new Error('oops!')
6 });
7 casper.run(function() {
8 test.done();
9 })
10 });