Update checked-in dependencies
This commit is contained in:
parent
3934d2b758
commit
655a969b7c
221 changed files with 2272 additions and 1525 deletions
40
node_modules/@octokit/auth-oauth-device/node_modules/universal-user-agent/index.test.js
generated
vendored
Normal file
40
node_modules/@octokit/auth-oauth-device/node_modules/universal-user-agent/index.test.js
generated
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { getUserAgent } from "./index.js";
|
||||
|
||||
if (getUserAgent instanceof Function === false) {
|
||||
throw new Error("getUserAgent is not a function");
|
||||
}
|
||||
|
||||
if (typeof getUserAgent() !== "string") {
|
||||
throw new Error("getUserAgent does not return a string");
|
||||
}
|
||||
|
||||
if ("Deno" in globalThis) {
|
||||
if (/Deno\//.test(getUserAgent()) === false) {
|
||||
throw new Error(
|
||||
"getUserAgent does not return the correct user agent for Deno"
|
||||
);
|
||||
}
|
||||
} else if ("Bun" in globalThis) {
|
||||
if (/Bun\//.test(getUserAgent()) === false) {
|
||||
throw new Error(
|
||||
"getUserAgent does not return the correct user agent for Bun"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (/Node\.js\//.test(getUserAgent()) === false) {
|
||||
throw new Error(
|
||||
"getUserAgent does not return the correct user agent for Node.js"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
delete globalThis.navigator;
|
||||
delete globalThis.process;
|
||||
|
||||
if (getUserAgent() !== "<environment undetectable>") {
|
||||
throw new Error(
|
||||
"getUserAgent does not return the correct user agent for undetectable environment"
|
||||
);
|
||||
}
|
||||
|
||||
console.info("getUserAgent test passed");
|
||||
Loading…
Add table
Add a link
Reference in a new issue