1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-23 07:29:51 -05:00
denoland-deno/cli/tests/integration/compat_tests.rs
Bartek Iwańczuk b686907a45
feat(compat): inject Node globals (#12342)
This commit adds automatic injection of Node globals when "--compat" flag
is present.

This is done by executing "https://deno.land/std/node/global.ts" as a "side module",
before main module is executed.

This commit makes "--compat" required to be used with "--unstable" flag, as some
of Node globals require unstable Deno APIs.
2021-10-06 19:07:04 +02:00

24 lines
683 B
Rust

// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use crate::itest;
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,
});