I\'m currently implementing \'unit testing\' in my angular application. However, if I run them, I receive multiple warnings/errors similar to this one: \'Error retrieving
\'Error retrieving
Using typemoq for mocking; following worked for me:
const mockIconRegistry = Mock.ofType(); mockIconRegistry.setup(s => s.getNamedSvgIcon(It.isAny(), It.isAny())).returns(() => of(Mock.ofType().object));
and then
providers: [{ provide: MatIconRegistry, useFactory: () => mockIconRegistry.object }]