Skip to content

Commit dbc0a08

Browse files
authoredApr 2, 2020
fix: only do type checking while compiling file (#1483)
1 parent 622fe4b commit dbc0a08

37 files changed

+1861
-885
lines changed
 

‎e2e/__cases__/compiler-host/main.spec.ts‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎e2e/__cases__/compiler-host/main.ts‎

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
import { strInNumOut } from './main'
1+
import { Thing } from "./main";
22

3-
it('should pass', () => {
4-
expect(strInNumOut('1')).toBe('1')
5-
})
3+
export const thing: Thing = { a: 1 };
4+
5+
function doTheThing() {
6+
return 1 + 2;
7+
}
8+
9+
it("should do the thing", () => {
10+
expect(doTheThing()).toEqual(3);
11+
});

‎e2e/__cases__/diagnostics/main.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
export function strInNumOut(input: string): number {
2-
return input
3-
}
1+
export type Thing = { a: number, b: number }
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Thing } from "./main";
2+
3+
// See the Thing definition. Changing the type definition should result in a compile failure here.
4+
export const thing: Thing = { a: 1 };
5+
function doTheThing() {
6+
return 1 + 2;
7+
}
8+
9+
it("should do the thing", () => {
10+
expect(doTheThing()).toEqual(3);
11+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type Thing = { a: number, b: number }

‎e2e/__helpers__/templates.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export enum PackageSets {
66
// invalid
77
unsupportedVersion = 'with-unsupported-version',
88
}
9-
export const allValidPackageSets = [PackageSets.default, PackageSets.babel7, PackageSets.babel7StringConfig, PackageSets.typescript2_7],
10-
allPackageSetsWithPreset = [PackageSets.default, PackageSets.babel7, PackageSets.babel7StringConfig, PackageSets.typescript2_7],
11-
allPackageSetsWithProgram = [PackageSets.default, PackageSets.babel7, PackageSets.babel7StringConfig],
12-
allPackageSetsWithoutProgram = [PackageSets.typescript2_7, PackageSets.unsupportedVersion]
9+
export const allValidPackageSets = [PackageSets.default, PackageSets.babel7, PackageSets.babel7StringConfig, PackageSets.typescript2_7]
10+
export const allPackageSetsWithPreset = [PackageSets.default, PackageSets.babel7, PackageSets.babel7StringConfig, PackageSets.typescript2_7]
11+
export const allPackageSetsWithProgram = [PackageSets.default, PackageSets.babel7, PackageSets.babel7StringConfig]
12+
export const allPackageSetsWithoutProgram = [PackageSets.typescript2_7, PackageSets.unsupportedVersion]

‎e2e/__tests__/__snapshots__/compiler-host.test.ts.snap‎

Lines changed: 0 additions & 213 deletions
This file was deleted.

0 commit comments

Comments
 (0)