describe('Directive bind', () => { let compile; beforeEach(ngModule('vnCore')); compile = html => { inject(($compile, $rootScope) => { let $element = $compile(html)($rootScope); $rootScope.$digest(); $element.remove(); }); }; it('should throw an error when the directive atribute is not set', () => { let html = `
`; expect(() => { compile(html); }).toThrow(Error(`vnBind: Binding keys not defined`)); }); it('should throw an error when the command modifier is not valid', () => { let html = `
`; expect(() => { compile(html); }).toThrow(new Error(`vnBind: Invalid modifier key in binding`)); }); });