Matteo Scandolo | ef96992 | 2016-08-11 13:49:12 -0700 | [diff] [blame] | 1 | 'use strict'; |
| 2 | |
| 3 | describe('The ErrorHandler service', () => { |
| 4 | |
| 5 | var ErrorHandler, done; |
| 6 | |
| 7 | beforeEach(module('xos.UITutorial')); |
| 8 | beforeEach(module('templates')); |
| 9 | |
| 10 | beforeEach(inject(function (_ErrorHandler_) { |
| 11 | // The injector unwraps the underscores (_) from around the parameter names when matching |
| 12 | ErrorHandler = _ErrorHandler_; |
| 13 | done = jasmine.createSpy('done'); |
| 14 | })); |
| 15 | |
| 16 | describe('the print method', () => { |
| 17 | it('should return an html template', () => { |
| 18 | ErrorHandler.print('myError', done); |
| 19 | expect(done).toHaveBeenCalledWith(`<span class="error">[ERROR] myError</span>`) |
| 20 | }); |
| 21 | }); |
| 22 | }); |