diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2023-07-13 19:29:51 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-13 23:29:51 +0000 |
| commit | b03d82e5d34ed11185fd3b9ce4db7bb838c65658 (patch) | |
| tree | ea4d490606168f6bd91f89e16b970b4b3a37ae19 /cli/tests/testdata/check/deno_unstable_not_found | |
| parent | 8465bd0037acbaac0c7dfab6a8c6dbf47539934e (diff) | |
fix(tsc): more informative diagnostic when `Deno` does not exist (#19825)
Also improved the diagnostic when using something like `Deno.openKv` and
it doesn't exist.
Diffstat (limited to 'cli/tests/testdata/check/deno_unstable_not_found')
| -rw-r--r-- | cli/tests/testdata/check/deno_unstable_not_found/main.out | 16 | ||||
| -rw-r--r-- | cli/tests/testdata/check/deno_unstable_not_found/main.ts | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/cli/tests/testdata/check/deno_unstable_not_found/main.out b/cli/tests/testdata/check/deno_unstable_not_found/main.out new file mode 100644 index 000000000..dfe3cf317 --- /dev/null +++ b/cli/tests/testdata/check/deno_unstable_not_found/main.out @@ -0,0 +1,16 @@ +error: TS2551 [ERROR]: Property 'openKv' does not exist on type 'typeof Deno'. Did you mean 'open'? 'Deno.openKv' is an unstable API. Did you forget to run with the '--unstable' flag, or did you mean 'open'? If not, try changing the 'lib' compiler option to include 'deno.unstable' or add a triple-slash directive to your entrypoint: /// <reference lib="deno.unstable" /> +Deno.openKv; + ~~~~~~ + at file:///[WILDCARD]/deno_unstable_not_found/main.ts:1:6 + + 'open' is declared here. + export function open( + ~~~~ + at asset:///lib.deno.ns.d.ts:1667:19 + +TS2339 [ERROR]: Property 'createHttpClient' does not exist on type 'typeof Deno'. 'Deno.createHttpClient' is an unstable API. Did you forget to run with the '--unstable' flag? If not, try changing the 'lib' compiler option to include 'deno.unstable' or add a triple-slash directive to your entrypoint: /// <reference lib="deno.unstable" /> +Deno.createHttpClient; + ~~~~~~~~~~~~~~~~ + at file:///[WILDCARD]/deno_unstable_not_found/main.ts:2:6 + +Found 2 errors. diff --git a/cli/tests/testdata/check/deno_unstable_not_found/main.ts b/cli/tests/testdata/check/deno_unstable_not_found/main.ts new file mode 100644 index 000000000..6661bd205 --- /dev/null +++ b/cli/tests/testdata/check/deno_unstable_not_found/main.ts @@ -0,0 +1,2 @@ +Deno.openKv; +Deno.createHttpClient; |
