// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.import{ createRequire }from"../module.ts";import{ isAbsolute }from"../../path/mod.ts"; /** * This module is used as an entry point for each test file * * The idea is to emulate a CommonJS environment without having to modify * the test files in any way * * Running with all permissions and unstable is recommended * * Usage: `deno run -A --unstable require.ts my_commonjs_file.js` */ const file =Deno.args[0];if(!file){thrownewError("No file provided");}elseif(!isAbsolute(file)){thrownewError("Path for file must be absolute");} constrequire=createRequire(file);require(file);