Skip to content

Commit

Permalink
fix: only do type checking while compiling file (#1483)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl authored Apr 2, 2020
1 parent 622fe4b commit dbc0a08
Show file tree
Hide file tree
Showing 37 changed files with 1,861 additions and 885 deletions.
6 changes: 0 additions & 6 deletions e2e/__cases__/compiler-host/main.spec.ts

This file was deleted.

1 change: 0 additions & 1 deletion e2e/__cases__/compiler-host/main.ts

This file was deleted.

14 changes: 10 additions & 4 deletions e2e/__cases__/diagnostics/main.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { strInNumOut } from './main'
import { Thing } from "./main";

it('should pass', () => {
expect(strInNumOut('1')).toBe('1')
})
export const thing: Thing = { a: 1 };

function doTheThing() {
return 1 + 2;
}

it("should do the thing", () => {
expect(doTheThing()).toEqual(3);
});
4 changes: 1 addition & 3 deletions e2e/__cases__/diagnostics/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export function strInNumOut(input: string): number {
return input
}
export type Thing = { a: number, b: number }
11 changes: 11 additions & 0 deletions e2e/__cases__/isolated-modules/main.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Thing } from "./main";

// See the Thing definition. Changing the type definition should result in a compile failure here.
export const thing: Thing = { a: 1 };
function doTheThing() {
return 1 + 2;
}

it("should do the thing", () => {
expect(doTheThing()).toEqual(3);
});
1 change: 1 addition & 0 deletions e2e/__cases__/isolated-modules/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type Thing = { a: number, b: number }
8 changes: 4 additions & 4 deletions e2e/__helpers__/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export enum PackageSets {
// invalid
unsupportedVersion = 'with-unsupported-version',
}
export const allValidPackageSets = [PackageSets.default, PackageSets.babel7, PackageSets.babel7StringConfig, PackageSets.typescript2_7],
allPackageSetsWithPreset = [PackageSets.default, PackageSets.babel7, PackageSets.babel7StringConfig, PackageSets.typescript2_7],
allPackageSetsWithProgram = [PackageSets.default, PackageSets.babel7, PackageSets.babel7StringConfig],
allPackageSetsWithoutProgram = [PackageSets.typescript2_7, PackageSets.unsupportedVersion]
export const allValidPackageSets = [PackageSets.default, PackageSets.babel7, PackageSets.babel7StringConfig, PackageSets.typescript2_7]
export const allPackageSetsWithPreset = [PackageSets.default, PackageSets.babel7, PackageSets.babel7StringConfig, PackageSets.typescript2_7]
export const allPackageSetsWithProgram = [PackageSets.default, PackageSets.babel7, PackageSets.babel7StringConfig]
export const allPackageSetsWithoutProgram = [PackageSets.typescript2_7, PackageSets.unsupportedVersion]
213 changes: 0 additions & 213 deletions e2e/__tests__/__snapshots__/compiler-host.test.ts.snap

This file was deleted.

Loading

0 comments on commit dbc0a08

Please sign in to comment.