Skip to content

Instantly share code, notes, and snippets.

@JohannesHoppe
Created June 20, 2016 19:31
Show Gist options
  • Save JohannesHoppe/c7715b947ef121cd58c9ffd4d4290fd5 to your computer and use it in GitHub Desktop.
Save JohannesHoppe/c7715b947ef121cd58c9ffd4d4290fd5 to your computer and use it in GitHub Desktop.
Substitute for ROUTER_FAKE_PROVIDERS @angular/[email protected] test workaround
/* workaround, see https://github.com/angular/vladivostok/issues/45 */
import { Router, ActivatedRoute } from '@angular/router';
class MockRouter { createUrlTree() {} }
class MockActivatedRoute { }
beforeEachProviders(() => [
provide(Router, { useClass: MockRouter }),
provide(ActivatedRoute, { useClass: MockActivatedRoute })
]);
/* workaround */
@JohannesHoppe
Copy link
Author

@huan
Copy link

huan commented Jul 28, 2016

link's broken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment