Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed May 22, 2020
1 parent dfbbe71 commit 641e541
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cli/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,13 @@ itest!(type_directives_redirect {
http_server: true,
});

itest!(ts_type_imports {
args: "run --reload ts_type_imports.ts",
output: "ts_type_imports.ts.out",
exit_code: 1,
http_server: true,
});

itest!(types {
args: "types",
output: "types.out",
Expand Down
3 changes: 3 additions & 0 deletions cli/tests/ts_type_imports.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Foo = import("./ts_type_imports_foo.ts").Foo;

const foo: Foo = new Map<string, string>();
6 changes: 6 additions & 0 deletions cli/tests/ts_type_imports.ts.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Compile [WILDCARD]ts_type_imports.ts
error: TS2322 [ERROR]: Type 'Map<string, string>' is not assignable to type 'Foo'.
Type 'string' is not assignable to type 'number'.
const foo: Foo = new Map<string, string>();
~~~
at [WILDCARD]ts_type_imports.ts:3:7
1 change: 1 addition & 0 deletions cli/tests/ts_type_imports_foo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type Foo = Map<string, number>;

0 comments on commit 641e541

Please sign in to comment.