Skip to content

Commit 86eb8f9

Browse files
Skip authed fixture on forks (#9681)
* Update run-tests.mjs * Fix formatting issues in run-tests.mjs - Split long lines to comply with 80 character limit - Improve readability with proper line breaks and indentation Co-authored-by: Somhairle MacLeòid <[email protected]> * fix format --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Somhairle MacLeòid <[email protected]>
1 parent 17d23d8 commit 86eb8f9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

fixtures/vitest-pool-workers-remote-bindings/run-tests.mjs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ import { execSync } from "child_process";
1111
import { randomUUID } from "crypto";
1212
import { cpSync, readFileSync, rmSync, writeFileSync } from "fs";
1313

14-
if (!process.env.TEST_CLOUDFLARE_API_TOKEN) {
15-
console.error("TEST_CLOUDFLARE_API_TOKEN must be set");
16-
process.exit(1);
17-
}
18-
19-
if (!process.env.TEST_CLOUDFLARE_ACCOUNT_ID) {
20-
console.error("TEST_CLOUDFLARE_ACCOUNT_ID must be set");
21-
process.exit(1);
14+
if (
15+
!process.env.TEST_CLOUDFLARE_API_TOKEN ||
16+
!process.env.TEST_CLOUDFLARE_ACCOUNT_ID
17+
) {
18+
console.warn("No credentials provided, skipping test...");
19+
process.exit(0);
2220
}
2321

2422
rmSync("./.tmp", { recursive: true, force: true });
@@ -27,7 +25,9 @@ cpSync("./src", "./.tmp/src", { recursive: true });
2725
cpSync("./test", "./.tmp/test", { recursive: true });
2826
cpSync("./vitest.workers.config.ts", "./.tmp/vitest.workers.config.ts");
2927

30-
const remoteWorkerName = `vitest-pool-workers-remote-worker-test-${randomUUID().split("-")[0]}`;
28+
const remoteWorkerName = `vitest-pool-workers-remote-worker-test-${
29+
randomUUID().split("-")[0]
30+
}`;
3131

3232
const wranglerJson = JSON.parse(readFileSync("./wrangler.json", "utf8"));
3333
wranglerJson.services[0].service = remoteWorkerName;

0 commit comments

Comments
 (0)