Is it possible to test an Angular Generic Component?
As an example, if I have
@Component({
...
})
export class MyComponent<T> implements OnInit {
public constructor(
private context: T
);
}
Where T can be any number of classes.
Then eventually I want to write a Jasmine test, but I am not able to determine the proper syntax for when creating the test fixture:
fixture = TestBed.createComponent(MyComponent<MyTestObject>);
It is here that TSLint complains:
Value of type 'typeof MyComponent' is not callable. Did you mean to include new?
It clearly thinks that I need a constructor (?), but is unclear how or where to implement that.
Is what I am attempting even possible? I can find examples of generic components. I can't find examples on setting up a test fixture / component