test utils refactoring

This commit is contained in:
Géry Debongnie
2019-03-04 22:47:20 +01:00
parent 8926b8828f
commit a162e40fe0
15 changed files with 494 additions and 394 deletions
+22
View File
@@ -0,0 +1,22 @@
import { Callback } from "../../src/ts/core/event_bus";
import { IRouter, Query, RouterEvent } from "../../src/ts/services/router";
export class MockRouter implements IRouter {
currentQuery: Query;
constructor(query: Query = {}) {
this.currentQuery = query;
}
navigate(query: Query) {
this.currentQuery = query;
}
on(event: RouterEvent, owner: any, callback: Callback) {}
getQuery(): Query {
return this.currentQuery;
}
formatURL(path: string, query: Query): string {
return "";
}
}