93
return stubObject;
94
}
96
>
public stubPromise<T>(service?: ServiceIdentifier<T>, fnProperty?: string, value?: any): T | sinon.SinonStub;
97
>
public stubPromise<T, V>(service?: ServiceIdentifier<T>, ctor?: any, fnProperty?: string, value?: V): V extends Function ? sinon.SinonSpy : sinon.SinonStub;
98
>
public stubPromise<T, V>(service?: ServiceIdentifier<T>, obj?: any, fnProperty?: string, value?: V): V extends Function ? sinon.SinonSpy : sinon.SinonStub;
99
>
public stubPromise(arg1?: any, arg2?: any, arg3?: any, arg4?: any): sinon.SinonStub | sinon.SinonSpy {
100
arg3 = typeof arg2 === 'string' ? Promise.resolve(arg3) : arg3;
101
arg4 = typeof arg2 !== 'string' && typeof arg3 === 'string' ? Promise.resolve(arg4) : arg4;
102
return this.stub(arg1, arg2, arg3, arg4);
103
}
105
>
public spy<T>(service: ServiceIdentifier<T>, fnProperty: string): sinon.SinonSpy {
106
const spy = sinon.spy();
107
this.stub(service, fnProperty, spy);
108
return spy;
109
}
111
>
private _create<T>(serviceMock: IServiceMock<T>, options: SinonOptions, reset?: boolean): any;
112
>
private _create<T>(ctor: any, options: SinonOptions): any;
113
>
private _create(arg1: any, options: SinonOptions, reset: boolean = false): any {
114
if (this.isServiceMock(arg1)) {
115
const service = this._getOrCreateService(arg1, options, reset);