summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2022-08-10 22:33:42 +0100
committerGitHub <noreply@github.com>2022-08-11 07:33:42 +1000
commit578f12d531b146661294771f002cf0d76bcc5f9a (patch)
tree6f3106287ad9a557f51c3343be645c98764c3718 /cli/tests
parentd9fae38d1e093fd2578c096203f1bddc18aa8ddb (diff)
fix(cli): allow configurations files to also be json modules (#15444)
Closes #15440
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration/run_tests.rs6
-rw-r--r--cli/tests/testdata/config_json_import.ts2
-rw-r--r--cli/tests/testdata/config_json_import.ts.out3
-rw-r--r--cli/tests/testdata/jsx/deno-jsx.json6
4 files changed, 17 insertions, 0 deletions
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"
+ }
+}