From 18a63dd977ade20e17d41c08acbefde6eada8572 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Tue, 30 Nov 2021 09:23:30 +1100 Subject: feat: add `--no-check=remote` flag (#12766) Closes #11970 --- cli/tests/integration/run_tests.rs | 13 +++++++++++++ cli/tests/testdata/no_check_remote.ts | 3 +++ cli/tests/testdata/no_check_remote.ts.disabled.out | 4 ++++ cli/tests/testdata/no_check_remote.ts.enabled.out | 1 + cli/tests/testdata/subdir/type_error.ts | 1 + 5 files changed, 22 insertions(+) create mode 100644 cli/tests/testdata/no_check_remote.ts create mode 100644 cli/tests/testdata/no_check_remote.ts.disabled.out create mode 100644 cli/tests/testdata/no_check_remote.ts.enabled.out create mode 100644 cli/tests/testdata/subdir/type_error.ts (limited to 'cli/tests') diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 47041e499..33ca787d9 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -920,6 +920,19 @@ itest!(no_check_decorators { output: "no_check_decorators.ts.out", }); +itest!(check_remote { + args: "run --quiet --reload no_check_remote.ts", + output: "no_check_remote.ts.disabled.out", + exit_code: 1, + http_server: true, +}); + +itest!(no_check_remote { + args: "run --quiet --reload --no-check=remote no_check_remote.ts", + output: "no_check_remote.ts.enabled.out", + http_server: true, +}); + itest!(runtime_decorators { args: "run --quiet --reload --no-check runtime_decorators.ts", output: "runtime_decorators.ts.out", diff --git a/cli/tests/testdata/no_check_remote.ts b/cli/tests/testdata/no_check_remote.ts new file mode 100644 index 000000000..2ae8c2692 --- /dev/null +++ b/cli/tests/testdata/no_check_remote.ts @@ -0,0 +1,3 @@ +import * as a from "http://localhost:4545/subdir/type_error.ts"; + +console.log(a.a); diff --git a/cli/tests/testdata/no_check_remote.ts.disabled.out b/cli/tests/testdata/no_check_remote.ts.disabled.out new file mode 100644 index 000000000..344264634 --- /dev/null +++ b/cli/tests/testdata/no_check_remote.ts.disabled.out @@ -0,0 +1,4 @@ +error: TS2322 [ERROR]: Type '12' is not assignable to type '"a"'. +export const a: "a" = 12; + ^ + at http://localhost:4545/subdir/type_error.ts:1:14 diff --git a/cli/tests/testdata/no_check_remote.ts.enabled.out b/cli/tests/testdata/no_check_remote.ts.enabled.out new file mode 100644 index 000000000..48082f72f --- /dev/null +++ b/cli/tests/testdata/no_check_remote.ts.enabled.out @@ -0,0 +1 @@ +12 diff --git a/cli/tests/testdata/subdir/type_error.ts b/cli/tests/testdata/subdir/type_error.ts new file mode 100644 index 000000000..cc3c1d29d --- /dev/null +++ b/cli/tests/testdata/subdir/type_error.ts @@ -0,0 +1 @@ +export const a: "a" = 12; -- cgit v1.2.3