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

Additional provider required for Unit Testing an Ionic2 project #4

Closed
CoreyCole opened this issue Dec 19, 2016 · 2 comments
Closed

Comments

@CoreyCole
Copy link

When following the Unit Testing an Ionic2 project tutorial, I ran into an error running the simple test.

Error: No provider for GestureController!

I fixed this by adding the following to my test.ts file:

import { App, MenuController, NavController, Platform, Config, Keyboard, Form, IonicModule, GestureController }  from 'ionic-angular';

...

providers: [
  App, Platform, Form, Keyboard, MenuController, NavController, GestureController,
  {provide: Config, useClass: ConfigMock}
]

I'd love to know more about why this happened. My project was generated using the ionic-cli after the release of rc3.

Environment

"ionic-angular": "2.0.0-rc.3"
"angular-cli": "^1.0.0-beta.22-1"
"karma": "1.3.0"
@lathonez
Copy link
Owner

lathonez commented Dec 19, 2016 via email

@CoreyCole
Copy link
Author

Thanks lathonez, I guess I was looking in the wrong repo for issues :)

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