3

I have a static method on my Component class that I am testing, my question is how it is possible to access that method within my spec testing file?

So far I can access a component instance with:

  let fixture = TestBed.createComponent(MyComponent);
  let comp = fixture.componentInstance;
Rodriguez David
  • 541
  • 9
  • 25

1 Answers1

11

Static methods are not bound to instances of classes. So something like this should work: MyComponent.nameOfStaticMethod(params)

Boris Lobanov
  • 2,409
  • 1
  • 11
  • 19