Hello
We were used to mock services in tests as follows:
test('Authentication service should work', function () {
expect(1);
var authManager = App.__container__.lookup('service:authentication.auth-manager');
// mock the transition
authManager.transitionTo = function (r) {
equal(r, 'credentials.signin');
};
return authManager
.initializeAuthentication()
.finally(disconnect);
});
But now with instance initializer to be executed when visit
helper is called I do not know where to mock services. At example above we do not use visit
helper at all. By the way
visit('/') andThen
will not work us, because at least there are many initializations and redirects in application route, which I do not want to be executed.
Do anybody have some advice.
Regards Jan