test(ext/node): assert imported argv0 value (#22568)

This commit is contained in:
Satya Rohith 2024-02-23 22:45:37 +05:30 committed by GitHub
parent 47dee65e4a
commit d2ed219dcb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,6 +4,7 @@
import process, {
arch as importedArch,
argv,
argv0 as importedArgv0,
env,
pid as importedPid,
platform as importedPlatform,
@ -303,6 +304,12 @@ Deno.test({
process.argv0.match(/[^/\\]*deno[^/\\]*$/),
"deno included in the file name of argv[0]",
);
assertEquals(typeof importedArgv0, "string");
assert(
importedArgv0.match(/[^/\\]*deno[^/\\]*$/),
"deno included in the file name of argv[0]",
);
// Setting should be a noop
process.argv0 = "foobar";
assert(