From 4731f4800c1bd62cb77112ef8c9f553ae9164395 Mon Sep 17 00:00:00 2001 From: uki00a Date: Mon, 13 Jul 2020 21:00:56 +0900 Subject: fix(Deno.ppid): improve error message when --unstable is missing (#6717) --- cli/tests/integration_tests.rs | 6 ++++++ cli/tests/unstable_disabled_ts2551.out | 10 ++++++++++ cli/tests/unstable_ts2551.ts | 1 + 3 files changed, 17 insertions(+) create mode 100644 cli/tests/unstable_disabled_ts2551.out create mode 100644 cli/tests/unstable_ts2551.ts (limited to 'cli/tests') diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 935454636..ec871d927 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -2073,6 +2073,12 @@ itest!(unstable_enabled_js { output: "unstable_enabled_js.out", }); +itest!(unstable_disabled_ts2551 { + args: "run --reload unstable_ts2551.ts", + exit_code: 1, + output: "unstable_disabled_ts2551.out", +}); + itest!(_053_import_compression { args: "run --quiet --reload --allow-net 053_import_compression/main.ts", output: "053_import_compression.out", diff --git a/cli/tests/unstable_disabled_ts2551.out b/cli/tests/unstable_disabled_ts2551.out new file mode 100644 index 000000000..bf8e6872b --- /dev/null +++ b/cli/tests/unstable_disabled_ts2551.out @@ -0,0 +1,10 @@ +[WILDCARD] +error: TS2551 [ERROR]: Property 'ppid' does not exist on type 'typeof Deno'. 'Deno.ppid' is an unstable API. Did you forget to run with the '--unstable' flag, or did you mean 'pid'? +console.log(Deno.ppid); + ~~~~ + at [WILDCARD]cli/tests/unstable_ts2551.ts:1:18 + + 'pid' is declared here. + export const pid: number; + ~~~ + at asset:///lib.deno.ns.d.ts:[WILDCARD] diff --git a/cli/tests/unstable_ts2551.ts b/cli/tests/unstable_ts2551.ts new file mode 100644 index 000000000..c9016c56c --- /dev/null +++ b/cli/tests/unstable_ts2551.ts @@ -0,0 +1 @@ +console.log(Deno.ppid); -- cgit v1.2.3