Part 37 -Angular Unit test case on lazy loading | Angular unit test case Tutorials in Jasmine& Karma

preview_player
Показать описание
Angular 8 Tutorial

SpyNgModuleFactoryLoader Doesn't work anymore in angular 13/14 since NgModuleFactoryLoader is deprecated and removed from Agular .
Replace SpyNgModuleFactoryLoader with NgModule
we can use ngModule instead of it like below
it('Lazy loading test case', fakeAsync(() = {

tick();
}));

you can see the source code for the same in the below link (search for 37)

Support Us

#AngularLazyLoading #angularunittest #Jasmine
Рекомендации по теме
Комментарии
Автор

Hello,
I am using lazy-loading without routing. Any idea how to test it ?

jean-paulboutros
Автор

SpyNgModuleFactoryLoader is not found angular 13 how to replace it? @The DotNet Office

anirudhlakshmipuram
Автор

Hi thanks for sharing but (Angular 15.0.3);

This lines gives me error: `const lazyloder = TestBed.inject(NgModule);`

```sh
NullInjectorError: -> DecoratorFactory]:
NullInjectorError: No provider for DecoratorFactory!
error properties: Object({ ngTempTokenPath: null, ngTokenPath: [ 'DecoratorFactory', 'DecoratorFactory' ] })
```

serkankonakc
welcome to shbcf.ru