mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-11 04:30:14 +00:00
Update according to review comment.
This commit is contained in:
3
types/sinon/ts3.1/index.d.ts
vendored
3
types/sinon/ts3.1/index.d.ts
vendored
@@ -1713,7 +1713,8 @@ declare namespace Sinon {
|
||||
*/
|
||||
createStubInstance<TType>(
|
||||
constructor: StubbableType<TType>,
|
||||
overrides?: { [K in keyof TType]?: any }
|
||||
overrides?: { [K in keyof TType]?:
|
||||
SinonStubbedMember<TType[K]> | TType[K] extends (...args: any[]) => infer R ? R : TType[K] }
|
||||
): SinonStubbedInstance<TType>;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ function testSandbox() {
|
||||
sb.replaceSetter(replaceMe, 'setter', (v) => { });
|
||||
|
||||
const cls = class {
|
||||
foo(arg1: string, arg2: number) { return 1; }
|
||||
foo(arg1: string, arg2: number): number { return 1; }
|
||||
bar: number;
|
||||
};
|
||||
const PrivateFoo = class {
|
||||
@@ -88,6 +88,7 @@ function testSandbox() {
|
||||
const clsBar: number = stubInstance.bar;
|
||||
const privateFooBar: number = privateFooStubbedInstance.bar;
|
||||
sb.createStubInstance(cls, {
|
||||
foo: (arg1: string, arg2: number) => 2,
|
||||
bar: 1
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user