summaryrefslogtreecommitdiff
path: root/cli/tests/integration_tests.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-05-02 00:32:05 +0200
committerGitHub <noreply@github.com>2020-05-02 00:32:05 +0200
commitde2c042482741dc23f7d975458a1fba95863de53 (patch)
treed9cb99d069a450ce708952b980ae15857b86a5d9 /cli/tests/integration_tests.rs
parent96fd0f4692126516239d61784caf6599aa884844 (diff)
BREAKING: remove support for JSON imports (#5037)
This commit removes support for importing JSON files as modules. This change is dictated by security; browsers rolled back on this support as well.
Diffstat (limited to 'cli/tests/integration_tests.rs')
-rw-r--r--cli/tests/integration_tests.rs39
1 files changed, 2 insertions, 37 deletions
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",