ng-mocks instead.
DEPRECATED: please useNgMocks consolidates mock-component, mock-directive, and mock-pipe into one package making it easier to maintain.
Also, if you like mock-component/ng-mocks you may also like shallow-render.
mock_component
Helper function for creating angular component mocks for test.
Why use this?
Sure, you could flip a flag on schema errors to make your component dependencies not matter. Or you could use this to mock them out and have the ability to assert on their inputs or emit on an output to assert on a side effect.
- Mocked component with the same selector.
- Inputs and Outputs with alias support
- Each component instance has its own EventEmitter instances for outputs
- Mocked component templates are ng-content tags to allow transclusion
- Allows ng-model binding (You will have to add FormsModule to TestBed imports)
- exportAs support
Usage Example
;;;;; describe'TestedComponent',;
Find an issue or have a request?
Report it as an issue or submit at PR. I'm open to contributions.