提交 e444eaa7 编写于 作者: M Matt Bierner

Strict null check serviceMock

上级 9b4099e4
......@@ -445,6 +445,7 @@
"./vs/platform/instantiation/common/instantiationService.ts",
"./vs/platform/instantiation/common/serviceCollection.ts",
"./vs/platform/instantiation/node/instantiationService.ts",
"./vs/platform/instantiation/test/common/instantiationServiceMock.ts",
"./vs/platform/integrity/common/integrity.ts",
"./vs/platform/integrity/node/integrityServiceImpl.ts",
"./vs/platform/issue/common/issue.ts",
......
......@@ -37,12 +37,12 @@ export class TestInstantiationService extends InstantiationService {
return <T>this._create(service, { mock: true });
}
public stub<T>(service?: ServiceIdentifier<T>, ctor?: any): T;
public stub<T>(service?: ServiceIdentifier<T>, obj?: any): T;
public stub<T>(service?: ServiceIdentifier<T>, ctor?: any, property?: string, value?: any): sinon.SinonStub;
public stub<T>(service?: ServiceIdentifier<T>, obj?: any, property?: string, value?: any): sinon.SinonStub;
public stub<T>(service?: ServiceIdentifier<T>, property?: string, value?: any): sinon.SinonStub;
public stub<T>(serviceIdentifier?: ServiceIdentifier<T>, arg2?: any, arg3?: string, arg4?: any): sinon.SinonStub {
public stub<T>(service: ServiceIdentifier<T>, ctor?: any): T;
public stub<T>(service: ServiceIdentifier<T>, obj?: any): T;
public stub<T>(service: ServiceIdentifier<T>, ctor?: any, property?: string, value?: any): sinon.SinonStub;
public stub<T>(service: ServiceIdentifier<T>, obj?: any, property?: string, value?: any): sinon.SinonStub;
public stub<T>(service: ServiceIdentifier<T>, property?: string, value?: any): sinon.SinonStub;
public stub<T>(serviceIdentifier: ServiceIdentifier<T>, arg2?: any, arg3?: string, arg4?: any): sinon.SinonStub {
let service = typeof arg2 !== 'string' ? arg2 : void 0;
let serviceMock: IServiceMock<any> = { id: serviceIdentifier, service: service };
let property = typeof arg2 === 'string' ? arg2 : arg3;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册