cnunciato / ng-mock-component

An Angular module for mocking components.
MIT License
53 stars 13 forks source link

Support component options including providers #18

Closed pkspks closed 5 years ago

pkspks commented 6 years ago

It is not possible to mock a component with providers. This is useful for a component that is a controlValueAccessor.

Now it's possible to mock a component that is a form input by specifying providers.

MockComponent({
selector: 'foo',
providers: [{
  provide: NG_VALUE_ACCESSOR,
  useValue: {/**provider implementation**/}
  multi: true
}]
})

This PR also takes care of any other scenarios where component properties are to be specified.

cnunciato commented 5 years ago

Thanks for the contribution!