@o3r/testing
Version:
The module provides testing (e2e, unit test) utilities to help you build your own E2E pipeline integrating visual testing.
27 lines • 1 kB
TypeScript
import { Type } from '@angular/core';
/**
* Generate a mock class base on a component file
* @param componentPath Path to the component file to mock
* @param config Object containing the following configurations:
* template: should be provided if the template contain `<ng-content></ng-content>`
* isControlValueAccessor: should be provided if the component extends ControlValueAccessor
* @param config.template
* @param config.isControlValueAccessor
* @example
* ```typescript
* // hero.component.ts
* \@Component({selector: 'hero'})
* class HeroComponent {
* \@Input() name: string;
* \@Output() doSomething: EventEmitter<void>
* }
*
* // mock generation
* class MockComponent extends generateMockComponent('hero.component.ts') {}
* ```
*/
export declare function generateMockComponent<T = Record<string, unknown>>(componentPath: string, config?: {
template?: string;
isControlValueAccessor?: boolean;
}): Type<T>;
//# sourceMappingURL=mock-component-generator.d.ts.map