2021-10-05 01:35:55 +02:00
|
|
|
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
|
|
|
|
|
|
|
use crate::itest;
|
2021-10-08 17:11:33 +02:00
|
|
|
use test_util as util;
|
2021-10-05 01:35:55 +02:00
|
|
|
|
2021-10-06 19:07:04 +02:00
|
|
|
itest!(globals {
|
|
|
|
args: "run --compat --unstable --allow-read --allow-env compat/globals.ts",
|
|
|
|
output: "compat/globals.out",
|
|
|
|
});
|
|
|
|
|
2021-10-05 01:35:55 +02:00
|
|
|
itest!(fs_promises {
|
2021-10-18 19:36:28 +02:00
|
|
|
args: "run --compat --unstable -A compat/fs_promises.mjs",
|
2021-10-05 01:35:55 +02:00
|
|
|
output: "compat/fs_promises.out",
|
|
|
|
});
|
|
|
|
|
2021-10-06 01:25:13 +02:00
|
|
|
itest!(node_prefix_fs_promises {
|
2021-10-18 19:36:28 +02:00
|
|
|
args: "run --compat --unstable -A compat/node_fs_promises.mjs",
|
2021-10-06 01:25:13 +02:00
|
|
|
output: "compat/fs_promises.out",
|
|
|
|
});
|
|
|
|
|
2021-10-08 17:11:33 +02:00
|
|
|
#[test]
|
|
|
|
fn globals_in_repl() {
|
2021-10-11 23:14:46 +02:00
|
|
|
let (out, _err) = util::run_and_collect_output_with_args(
|
2021-10-08 17:11:33 +02:00
|
|
|
true,
|
|
|
|
vec!["repl", "--compat", "--unstable", "--quiet"],
|
|
|
|
Some(vec!["global == window"]),
|
|
|
|
None,
|
|
|
|
false,
|
|
|
|
);
|
|
|
|
assert!(out.contains("true"));
|
|
|
|
}
|