From 3fab5d9879272b9f991a67c8135754f00c055834 Mon Sep 17 00:00:00 2001 From: Andres Ornelas Date: Mon, 24 May 2010 15:25:30 -0700 Subject: added error handling on scenario definition --- test/scenario/RunnerSpec.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/scenario/RunnerSpec.js b/test/scenario/RunnerSpec.js index 702e1ab5..35d74f51 100644 --- a/test/scenario/RunnerSpec.js +++ b/test/scenario/RunnerSpec.js @@ -37,7 +37,23 @@ describe('Runner', function(){ }); it('should camplain on duplicate it', angular.noop); - + it('should create a failing step if there is a javascript error', function(){ + var spec; + Describe('D1', function(){ + It('I1', function(){ + spec = $scenario.currentSpec; + throw {message: 'blah'}; + }); + }); + var step = spec.steps[0]; + expect(step.name).toEqual('blah'); + try { + step.fn(); + fail(); + } catch (e) { + expect(e.message).toEqual('blah'); + }; + }); }); }); -- cgit v1.2.3