0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-30 09:08:00 -04:00
denoland-deno/cli/tests/integration/compat_tests.rs
2021-10-08 17:11:33 +02:00

38 lines
1,019 B
Rust

// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use crate::itest;
use test_util as util;
itest!(globals {
args: "run --compat --unstable --allow-read --allow-env compat/globals.ts",
output: "compat/globals.out",
});
itest!(fs_promises {
args: "run --compat --unstable -A compat/fs_promises.js",
output: "compat/fs_promises.out",
});
itest!(node_prefix_fs_promises {
args: "run --compat --unstable -A compat/node_fs_promises.js",
output: "compat/fs_promises.out",
});
itest!(existing_import_map {
args: "run --compat --unstable --import-map compat/existing_import_map.json compat/fs_promises.js",
output: "compat/existing_import_map.out",
exit_code: 1,
});
#[test]
fn globals_in_repl() {
let (out, err) = util::run_and_collect_output_with_args(
true,
vec!["repl", "--compat", "--unstable", "--quiet"],
Some(vec!["global == window"]),
None,
false,
);
assert!(out.contains("true"));
assert!(err.contains("Implicitly using latest version"));
}