summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/020_json_modules.ts.out10
-rw-r--r--cli/tests/050_more_jsons.ts7
-rw-r--r--cli/tests/050_more_jsons.ts.out9
-rw-r--r--cli/tests/integration_tests.rs39
4 files changed, 11 insertions, 54 deletions
diff --git a/cli/tests/020_json_modules.ts.out b/cli/tests/020_json_modules.ts.out
index 5d1623e6b..02106dafc 100644
--- a/cli/tests/020_json_modules.ts.out
+++ b/cli/tests/020_json_modules.ts.out
@@ -1 +1,9 @@
-{"foo":{"bar":true,"baz":["qat",1]}}
+[WILDCARD]
+error: Uncaught TypeError: Cannot resolve extension for "[WILDCARD]config.json" with mediaType "Json".
+ at getExtension ($deno$/compiler/sourcefile.ts:[WILDCARD])
+ at new SourceFile ($deno$/compiler/sourcefile.ts:[WILDCARD])
+ at processImports ($deno$/compiler/imports.ts:[WILDCARD])
+ at async Object.processImports ($deno$/compiler/imports.ts:[WILDCARD])
+ at async compile ([WILDCARD]compiler.ts:[WILDCARD])
+ at async tsCompilerOnMessage ([WILDCARD]compiler.ts:[WILDCARD])
+ at async workerMessageRecvCallback ($deno$/runtime_worker.ts:[WILDCARD])
diff --git a/cli/tests/050_more_jsons.ts b/cli/tests/050_more_jsons.ts
deleted file mode 100644
index 90deabcd1..000000000
--- a/cli/tests/050_more_jsons.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import j1, { $var } from "./subdir/json_1.json";
-import j2 from "./subdir/json_2.json";
-console.log($var);
-console.log($var.a);
-console.log(j1);
-console.log(j1["with space"]);
-console.log(j2);
diff --git a/cli/tests/050_more_jsons.ts.out b/cli/tests/050_more_jsons.ts.out
deleted file mode 100644
index c3d1e5cbf..000000000
--- a/cli/tests/050_more_jsons.ts.out
+++ /dev/null
@@ -1,9 +0,0 @@
-{ a: 123, b: [ 1, 2, 3 ], c: null }
-123
-{
- $var: { a: 123, b: [ 1, 2, 3 ], c: null },
- with space: "invalid variable name",
- function: "reserved word"
-}
-invalid variable name
-just a string
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index 953f92c66..fbaab7674 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -396,38 +396,6 @@ fn bundle_single_module() {
}
#[test]
-fn bundle_json() {
- let json_modules = util::root_path().join("cli/tests/020_json_modules.ts");
- assert!(json_modules.is_file());
- let t = TempDir::new().expect("tempdir fail");
- let bundle = t.path().join("020_json_modules.bundle.js");
- let mut deno = util::deno_cmd()
- .current_dir(util::root_path())
- .arg("bundle")
- .arg(json_modules)
- .arg(&bundle)
- .spawn()
- .expect("failed to spawn script");
- let status = deno.wait().expect("failed to wait for the child process");
- assert!(status.success());
- assert!(bundle.is_file());
-
- let output = util::deno_cmd()
- .current_dir(util::root_path())
- .arg("run")
- .arg("--reload")
- .arg(&bundle)
- .output()
- .expect("failed to spawn script");
- // check the output of the the bundle program.
- assert!(std::str::from_utf8(&output.stdout)
- .unwrap()
- .trim()
- .ends_with("{\"foo\":{\"bar\":true,\"baz\":[\"qat\",1]}}"));
- assert_eq!(output.stderr, b"");
-}
-
-#[test]
fn bundle_tla() {
// First we have to generate a bundle of some module that has exports.
let tla_import = util::root_path().join("cli/tests/subdir/tla.ts");
@@ -927,7 +895,9 @@ itest_ignore!(_019_media_types {
itest!(_020_json_modules {
args: "run --reload 020_json_modules.ts",
+ check_stderr: true,
output: "020_json_modules.ts.out",
+ exit_code: 1,
});
itest!(_021_mjs_modules {
@@ -1127,11 +1097,6 @@ itest_ignore!(_049_info_flag_script_jsx {
http_server: true,
});
-itest!(_050_more_jsons {
- args: "run --reload 050_more_jsons.ts",
- output: "050_more_jsons.ts.out",
-});
-
itest!(_051_wasm_import {
args: "run --reload --allow-net --allow-read 051_wasm_import.ts",
output: "051_wasm_import.ts.out",