DEV Community

Salah Hasanin
Salah Hasanin

Posted on

Answer: ng test throws error on angular material components

In Angular component tests, if your component has dependencies, you need to either mock them or import them. With Material components, this means importing the modules for any components used in the tested component when configuring the testing module. For example:

beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ DeleteBotModalComponent ]
      imports:

Top comments (0)