aboutsummaryrefslogtreecommitdiff
path: root/test/generateReport.ts
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-12-20 02:59:16 +0100
committerVendicated <vendicated@riseup.net>2022-12-20 02:59:16 +0100
commit0743c1215e539765cf4ea90a690ccdbab8a2cb55 (patch)
treea8dfd3ebe750b2b64f65bb1475e45da3b4fb8924 /test/generateReport.ts
parent94ad8e8f61abb3c6256f9caa39878150b326790f (diff)
downloadVencord-0743c1215e539765cf4ea90a690ccdbab8a2cb55.tar.gz
Vencord-0743c1215e539765cf4ea90a690ccdbab8a2cb55.tar.bz2
Vencord-0743c1215e539765cf4ea90a690ccdbab8a2cb55.zip
Add canary test
Diffstat (limited to 'test/generateReport.ts')
-rw-r--r--test/generateReport.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/generateReport.ts b/test/generateReport.ts
index 57d4f96..9483225 100644
--- a/test/generateReport.ts
+++ b/test/generateReport.ts
@@ -31,13 +31,15 @@ for (const variable of ["DISCORD_TOKEN", "CHROMIUM_BIN"]) {
}
}
+const CANARY = process.env.USE_CANARY === "true";
+
const browser = await pup.launch({
headless: true,
executablePath: process.env.CHROMIUM_BIN
});
const page = await browser.newPage();
-await page.setUserAgent("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36");
+await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36");
function maybeGetError(handle: JSHandle) {
return (handle as JSHandle<Error>)?.getProperty("message")
@@ -65,7 +67,7 @@ function toCodeBlock(s: string) {
}
async function printReport() {
- console.log("# Vencord Report");
+ console.log("# Vencord Report" + (CANARY ? " (Canary)" : ""));
console.log();
console.log("## Bad Patches");
@@ -98,7 +100,7 @@ async function printReport() {
},
body: JSON.stringify({
description: "Here's the latest Vencord Report!",
- username: "Vencord Reporter",
+ username: "Vencord Reporter" + (CANARY ? " (Canary)" : ""),
avatar_url: "https://cdn.discordapp.com/icons/1015060230222131221/f0204a918c6c9c9a43195997e97d8adf.webp",
embeds: [
{
@@ -271,4 +273,4 @@ await page.evaluateOnNewDocument(`
;(${runTime.toString()})(${JSON.stringify(process.env.DISCORD_TOKEN)});
`);
-await page.goto("https://discord.com/login");
+await page.goto(CANARY ? "https://canary.discord.com/login" : "https://discord.com/login");