import { ConnectionState } from '../../../common/src/signalR'; export class myProx { public url: string; public name: string; constructor(){ this.url = "test.mock"; this.name = "test"; } public on(event :string, fn: any){ fn(null, null, null); } public invoke(...any){ return { done : ()=>{ return { fail: ()=>{} } } }; } } export class mockHubCon { public url: string; public proxy: myProx; public qs: any; constructor(){ } public createHubProxy(name: string){ this.proxy = new myProx; return this.proxy; } public start(){ let res = { done : (x)=>{x(); return { fail : (x)=>{x()} } } }; return res; } public stateChanged(fn :any){ return fn({ newState : ConnectionState.Connected }); } public error(fn){ fn(new Error("test")); } }