diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/error_005_missing_dynamic_import.ts.out | 2 | ||||
-rw-r--r-- | cli/tests/error_012_bad_dynamic_import_specifier.ts.out | 2 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs | 7 | ||||
-rw-r--r-- | cli/tests/ts_type_imports.ts | 5 | ||||
-rw-r--r-- | cli/tests/ts_type_imports.ts.out | 6 | ||||
-rw-r--r-- | cli/tests/ts_type_imports_foo.ts | 1 |
6 files changed, 21 insertions, 2 deletions
diff --git a/cli/tests/error_005_missing_dynamic_import.ts.out b/cli/tests/error_005_missing_dynamic_import.ts.out index 0f0e449c4..346e8cd6f 100644 --- a/cli/tests/error_005_missing_dynamic_import.ts.out +++ b/cli/tests/error_005_missing_dynamic_import.ts.out @@ -1 +1 @@ -[WILDCARD]error: Uncaught TypeError: Cannot resolve module "[WILDCARD]/bad-module.ts" +error: Cannot resolve module "[WILDCARD]/bad-module.ts" from "[WILDCARD]/error_005_missing_dynamic_import.ts" diff --git a/cli/tests/error_012_bad_dynamic_import_specifier.ts.out b/cli/tests/error_012_bad_dynamic_import_specifier.ts.out index 57e4003ce..7bebeda12 100644 --- a/cli/tests/error_012_bad_dynamic_import_specifier.ts.out +++ b/cli/tests/error_012_bad_dynamic_import_specifier.ts.out @@ -1 +1 @@ -[WILDCARD]error: Uncaught TypeError: relative import path "bad-module.ts" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/error_012_bad_dynamic_import_specifier.ts" +error: relative import path "bad-module.ts" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/error_012_bad_dynamic_import_specifier.ts" diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 59e5f554d..9f73c91b3 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -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", diff --git a/cli/tests/ts_type_imports.ts b/cli/tests/ts_type_imports.ts new file mode 100644 index 000000000..f39dc7500 --- /dev/null +++ b/cli/tests/ts_type_imports.ts @@ -0,0 +1,5 @@ +/* eslint-disable */ + +type Foo = import("./ts_type_imports_foo.ts").Foo; + +const foo: Foo = new Map<string, string>(); diff --git a/cli/tests/ts_type_imports.ts.out b/cli/tests/ts_type_imports.ts.out new file mode 100644 index 000000000..2763fbce1 --- /dev/null +++ b/cli/tests/ts_type_imports.ts.out @@ -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:5:7 diff --git a/cli/tests/ts_type_imports_foo.ts b/cli/tests/ts_type_imports_foo.ts new file mode 100644 index 000000000..db20773f6 --- /dev/null +++ b/cli/tests/ts_type_imports_foo.ts @@ -0,0 +1 @@ +export type Foo = Map<string, number>; |