login() {
const endPoint = environment.myEndPoint;
window.location.href = endPoint + '/myPath/login';
}
I am having angular service file with above code written in it to redirect to login URL. Now, I have written the below code in spec file to unit test it.
it('should call login method',() => {
service.digitalssologin();
});
This test case sometimes covers the login method and executes successfully, while sometimes it fails and karma tool disconnects, so other test cases also stops executing. Is there any other way to write test case for this method?
Thanks in advance.