ionic-mocks icon indicating copy to clipboard operation
ionic-mocks copied to clipboard

NullInjectorError: No provider for Storage!

Open BielMaracaja opened this issue 6 years ago • 1 comments

Error: StaticInjectorError(DynamicTestModule)[MyApp -> Storage]: StaticInjectorError(Platform: core)[MyApp -> Storage]: NullInjectorError: No provider for Storage!

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [MyApp],
      imports: [
        IonicModule.forRoot(MyApp)
      ],
      providers: [
        { provide: StatusBar, useFactory: () => StatusBarMock.instance() },
        { provide: SplashScreen, useFactory: () => SplashScreenMock.instance() },
        { provide: Platform, useFactory: () => PlatformMock.instance() },
        { provide: Storage, useFactory: () => StorageMock.instance('introMostrada', false) },
        { provide: HeaderColor, useClass: HeaderColorMock }
      ]
    })
  }));

"ionic-mocks": "^1.3.0"

Any ideias?

BielMaracaja avatar May 27 '18 19:05 BielMaracaja

Did you find out what was wrong there @BielMaracaja ? I have the exact same problem.

distante avatar Dec 15 '18 09:12 distante