I want to test a component, which can accept array with a different types of data, for existence, but Typescript show me an error:
Error:(7, 18) TS2314: Generic type 'AppTableComponent<T>' requires 1 type argument(s).
My component file:
export class AppTableComponent<T> {
@Input() data: T[];
constructor() {}
}
Test file
describe('AppTableComponent', () => {
let component: AppTableComponent;
let fixture: ComponentFixture;
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [
AppTableComponent,
MockComponent( PreloaderComponent ),
],
}).compileComponents();
fixture = TestBed.createComponent(AppTableComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
How to resolve this error?