diff options
| author | Andres Ornelas | 2010-05-24 15:25:30 -0700 |
|---|---|---|
| committer | Andres Ornelas | 2010-05-24 15:25:30 -0700 |
| commit | 3fab5d9879272b9f991a67c8135754f00c055834 (patch) | |
| tree | 2f33b6de3e3d0900c0bdba3b198e15dceac63712 /test/scenario/RunnerSpec.js | |
| parent | f6c67e28c94033edf6a16eb6508de54679cb49db (diff) | |
| download | angular.js-3fab5d9879272b9f991a67c8135754f00c055834.tar.bz2 | |
added error handling on scenario definition
Diffstat (limited to 'test/scenario/RunnerSpec.js')
| -rw-r--r-- | test/scenario/RunnerSpec.js | 18 |
1 files changed, 17 insertions, 1 deletions
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'); + }; + }); }); }); |
