angular - Testing component with modules I don't want to include -


in component i'm trying setup testing for, template use third party modules, such ng2-bootstrap modules alertmodule or dropdownmodule.

they irrelevant tests i'm trying setup particular component. if don't include them, test fails html fails compile due unknown directives , on.

is there way create false "empty" modules import, or better don't care them , make angular ignore third party modules don't have include them in testbed (they won't rendered on template don't care here since tests doesn't involve them).

if there component don't need declare can either mock them or use no_errors_schema suggested in error , in angular doc this:

beforeeach( async(() => { testbed.configuretestingmodule({ declarations: [ appcomponent, routerlinkstubdirective ], schemas:      [ no_errors_schema ] }) 

look https://angular.io/docs/ts/latest/guide/testing.html#!#shallow-component-test more info :)


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -