angularjs - Mock a Angular 1.5 component in unit tests -


i have basic angular 1.5 component looking :

angular   .module('app')   .component('techs', {     templateurl: 'app/techs/techs.html',     controller: techscontroller   }); 

and mock only component , not whole app because angular.mock.module('app') mocks every components of app. there way ?
tried angular.mock.module('techs') have error occuring :

failed instantiate module techs due to: module 'techs' not available! either misspelled module name or forgot load 

you should inject components $componentcontroller.

forex: component = $componentcontroller('component', {yourscope}, {yourbindings}); 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -