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
Uncaught TypeError: Cannot read property 'hasRoute' of undefined #12052
Comments
You are using the private I am not opposed to tweaking https://github.com/emberjs/ember.js/blob/master/packages/ember-routing/lib/services/routing.js#L37 a bit to prevent this error (it should ultimately return false if |
Closing this issue, but I'd happily review a PR. |
Late for the game, but I just want to show the way I did to solve such issues. Just override the methods. const service = this.subject({
routing: {
transitionTo() {
return true;
}
}
}) I'm doing this because I've written tests for testing different routes itself, also trust on ember team to test |
One way of stubbing it without failing the test case |
I have an auth service that I'm trying to write a unit test for.
When there isn't a previous transition stored in the Auth service, it redirects to a specific route.
The app works as expected, however the tests for this service give the following error:
I don't know how to debug / solve this. What's going on?
Here's my auth service:
And my router:
Here's the test for that service:
Using Ember 2.0.0-beta.5
The text was updated successfully, but these errors were encountered: