mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Added more tests for #22180
This commit is contained in:
31
tests/cases/fourslash/codeFixUndeclaredMethodFunctionArgs.ts
Normal file
31
tests/cases/fourslash/codeFixUndeclaredMethodFunctionArgs.ts
Normal 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.");
|
||||
}
|
||||
`
|
||||
});
|
||||
@@ -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.");
|
||||
}
|
||||
`
|
||||
});
|
||||
Reference in New Issue
Block a user