Added more tests for #22180

This commit is contained in:
Markus Johnsson
2018-02-28 12:07:41 +01:00
parent 627c95e3f5
commit 67eb6fc859
2 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
/// <reference path='fourslash.ts' />
//// class A {[|
//// |]constructor() {
//// this.foo1(() => 1, () => "2", () => false);
//// this.foo2((a: number) => a, (b: string) => b, (c: boolean) => c);
//// }
//// }
verify.codeFix({
description: "Declare method 'foo1'",
index: 0,
newRangeContent: `
foo1(arg0: () => number, arg1: () => string, arg2: () => boolean): any {
throw new Error("Method not implemented.");
}
`,
});
verify.codeFix({
description: "Declare method 'foo2'",
index: 0,
newRangeContent: `
foo2(arg0: (a: number) => number, arg1: (b: string) => string, arg2: (c: boolean) => boolean): any {
throw new Error("Method not implemented.");
}
foo1(arg0: () => number, arg1: () => string, arg2: () => boolean): any {
throw new Error("Method not implemented.");
}
`
});

View File

@@ -0,0 +1,17 @@
/// <reference path='fourslash.ts' />
//// class A {[|
//// |]constructor() {
//// this.foo1(null, {}, { a: 1, b: "2"});
//// }
//// }
verify.codeFix({
description: "Declare method 'foo1'",
index: 0,
newRangeContent: `
foo1(arg0: null, arg1: {}, arg2: { a: number; b: string; }): any {
throw new Error("Method not implemented.");
}
`
});