From 578f12d531b146661294771f002cf0d76bcc5f9a Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Wed, 10 Aug 2022 22:33:42 +0100 Subject: fix(cli): allow configurations files to also be json modules (#15444) Closes #15440 --- cli/tests/integration/run_tests.rs | 6 ++++++ cli/tests/testdata/config_json_import.ts | 2 ++ cli/tests/testdata/config_json_import.ts.out | 3 +++ cli/tests/testdata/jsx/deno-jsx.json | 6 ++++++ 4 files changed, 17 insertions(+) create mode 100644 cli/tests/testdata/config_json_import.ts create mode 100644 cli/tests/testdata/config_json_import.ts.out create mode 100644 cli/tests/testdata/jsx/deno-jsx.json (limited to 'cli/tests') diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 7354dbf1d..adaa6d49d 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -2754,6 +2754,12 @@ itest!(custom_inspect_url { output: "custom_inspect_url.js.out", }); +itest!(config_json_import { + args: "run --quiet -c jsx/deno-jsx.json config_json_import.ts", + output: "config_json_import.ts.out", + http_server: true, +}); + #[test] fn running_declaration_files() { let temp_dir = TempDir::new(); diff --git a/cli/tests/testdata/config_json_import.ts b/cli/tests/testdata/config_json_import.ts new file mode 100644 index 000000000..d344c0fb7 --- /dev/null +++ b/cli/tests/testdata/config_json_import.ts @@ -0,0 +1,2 @@ +import config from "./jsx/deno-jsx.json" assert { type: "json" }; +console.log(config); diff --git a/cli/tests/testdata/config_json_import.ts.out b/cli/tests/testdata/config_json_import.ts.out new file mode 100644 index 000000000..aa55be7d5 --- /dev/null +++ b/cli/tests/testdata/config_json_import.ts.out @@ -0,0 +1,3 @@ +{ + compilerOptions: { jsx: "react-jsx", jsxImportSource: "http://localhost:4545/jsx" } +} diff --git a/cli/tests/testdata/jsx/deno-jsx.json b/cli/tests/testdata/jsx/deno-jsx.json new file mode 100644 index 000000000..311409ea3 --- /dev/null +++ b/cli/tests/testdata/jsx/deno-jsx.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} -- cgit v1.2.3