Skip to content

Instantly share code, notes, and snippets.

View enmy726's full-sized avatar
💭
未来はここにある [JP && CN ] ^^

enmy726

💭
未来はここにある [JP && CN ] ^^
View GitHub Profile
@dvaJi
dvaJi / mock-active-router.ts
Created May 16, 2019 23:35
Mock ActivatedRoute (with snapshot, queryParams and params), tested in Angular 7+
import { Params } from '@angular/router';
import { BehaviorSubject } from 'rxjs';
export class MockActivatedRoute {
private innerTestParams?: any;
private subject?: BehaviorSubject<any> = new BehaviorSubject(this.testParams);
params = this.subject.asObservable();
queryParams = this.subject.asObservable();