mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
Add tests for different constructor parameter cases.
This commit is contained in:
8
tests/cases/fourslash/unusedParameterInConstructor2.ts
Normal file
8
tests/cases/fourslash/unusedParameterInConstructor2.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @noUnusedLocals: true
|
||||
//// class C1 {
|
||||
//// [|constructor(public p1: string, private p2: boolean, public p3: any, p5)|] { p5; }
|
||||
//// }
|
||||
|
||||
verify.codeFixAtPosition("constructor(public p1: string, public p3: any, p5)");
|
||||
8
tests/cases/fourslash/unusedParameterInConstructor3.ts
Normal file
8
tests/cases/fourslash/unusedParameterInConstructor3.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @noUnusedLocals: true
|
||||
//// class C1 {
|
||||
//// [|constructor(public p1: string, public p2: boolean, private p3: any, p5)|] { p5; }
|
||||
//// }
|
||||
|
||||
verify.codeFixAtPosition("constructor(public p1: string, public p2: boolean, p5)");
|
||||
8
tests/cases/fourslash/unusedParameterInConstructor4.ts
Normal file
8
tests/cases/fourslash/unusedParameterInConstructor4.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @noUnusedLocals: true
|
||||
//// class C1 {
|
||||
//// [|constructor(private readonly p2: boolean, p5)|] { p5; }
|
||||
//// }
|
||||
|
||||
verify.codeFixAtPosition("constructor(p5)");
|
||||
Reference in New Issue
Block a user