add tests

This commit is contained in:
Arthur Ozga 2017-02-14 18:10:21 -08:00
parent f133a6755e
commit 150e2fbf50
5 changed files with 50 additions and 6 deletions

View File

@ -0,0 +1,22 @@
/// <reference path='fourslash.ts' />
//// class A {
//// a: number;
//// b: string;
//// constructor(public x: any) {}
//// }
//// [|class B {
//// constructor() {
//// this.x = new A(3);
//// }
//// }|]
verify.rangeAfterCodeFix(`
class B {
x: A;
constructor() {
this.x = new A(3);
}
}
`, /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0);

View File

@ -0,0 +1,22 @@
/// <reference path='fourslash.ts' />
//// class A<T> {
//// a: number;
//// b: string;
//// constructor(public x: T) {}
//// }
//// [|class B {
//// constructor() {
//// this.x = new A(3);
//// }
//// }|]
verify.rangeAfterCodeFix(`
class B {
x: A<number>;
constructor() {
this.x = new A(3);
}
}
`, /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0);

View File

@ -14,4 +14,4 @@ class A {
this.x = 10;
}
}
`);
`, /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0);

View File

@ -8,10 +8,10 @@
verify.rangeAfterCodeFix(`
class A {
x: { a: number, b: string };
x: { a: number; b: string; };
constructor() {
this.x = 10;
this.x = { a: 10, b: "hello" };
}
}
`);
`, /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0);

View File

@ -225,7 +225,7 @@ declare namespace FourSlashInterface {
noMatchingBracePositionInCurrentFile(bracePosition: number): void;
DocCommentTemplate(expectedText: string, expectedOffset: number, empty?: boolean): void;
noDocCommentTemplate(): void;
rangeAfterCodeFix(expectedText: string, includeWhiteSpace?: boolean, errorCode?: number): void;
rangeAfterCodeFix(expectedText: string, includeWhiteSpace?: boolean, errorCode?: number, index?: number): void;
importFixAtPosition(expectedTextArray: string[], errorCode?: number): void;
navigationBar(json: any): void;