Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullInjectorError: No provider for Storage! #52

Open
BielMaracaja opened this issue May 27, 2018 · 1 comment
Open

NullInjectorError: No provider for Storage! #52

BielMaracaja opened this issue May 27, 2018 · 1 comment

Comments

@BielMaracaja
Copy link

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?

@distante
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants