Skip to content

Commit d3a5cf6

Browse files
authored
Skip mixed mode tests when tokens not provided (#9213)
* Skip when tokens not provided * Add explanation
1 parent 0e215b0 commit d3a5cf6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

fixtures/mixed-mode-node-test/tests/startMixedModeSession.test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ import { experimental_startMixedModeSession } from "wrangler";
66
process.env.CLOUDFLARE_ACCOUNT_ID = process.env.TEST_CLOUDFLARE_ACCOUNT_ID;
77
process.env.CLOUDFLARE_API_TOKEN = process.env.TEST_CLOUDFLARE_API_TOKEN;
88

9-
describe("startMixedModeSession", () => {
9+
// Mixed Mode relies on deploying a Worker to a user's account, and so the following tests require authentication
10+
// This is provided in CI, but forks of the repo/running the fixture tests locally won't necessarily have authentication
11+
// As such, we skip the tests if authentication isn't provided.
12+
const baseDescribe =
13+
process.env.TEST_CLOUDFLARE_ACCOUNT_ID &&
14+
process.env.TEST_CLOUDFLARE_API_TOKEN
15+
? describe
16+
: describe.skip;
17+
18+
baseDescribe("startMixedModeSession", () => {
1019
test("simple AI request to the proxyServerWorker", async () => {
1120
const mixedModeSession = await experimental_startMixedModeSession({
1221
AI: {

0 commit comments

Comments
 (0)