test(aio): add mock services
This commit is contained in:
parent
b7e76cc2e1
commit
b44bc9c022
|
@ -0,0 +1,8 @@
|
|||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||
|
||||
export class MockLocationService {
|
||||
urlSubject = new BehaviorSubject<string>(this.initialUrl);
|
||||
currentUrl = this.urlSubject.asObservable();
|
||||
constructor(private initialUrl) {}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable()
|
||||
export class MockLogger {
|
||||
|
||||
output = {
|
||||
log: [],
|
||||
error: [],
|
||||
warn: []
|
||||
};
|
||||
|
||||
log(value: any, ...rest) {
|
||||
this.output.log.push([value, ...rest]);
|
||||
}
|
||||
|
||||
error(value: any, ...rest) {
|
||||
this.output.error.push([value, ...rest]);
|
||||
}
|
||||
|
||||
warn(value: any, ...rest) {
|
||||
this.output.warn.push([value, ...rest]);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue