Skip to content

Commit eee8557

Browse files
authored
chore: run account_id test only when credentials is set (#11459)
1 parent d25f7e2 commit eee8557

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

packages/vite-plugin-cloudflare/e2e/remote-bindings.test.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,28 @@ if (!process.env.CLOUDFLARE_ACCOUNT_ID || !process.env.CLOUDFLARE_API_TOKEN) {
137137
);
138138
});
139139
});
140+
141+
describe("remote bindings without actually establishing a remote connection", () => {
142+
const projectPath = seed("remote-bindings-config-account-id", "pnpm");
143+
144+
test("for connection to remote bindings during dev the account_id present in the wrangler config file is used", async ({
145+
expect,
146+
}) => {
147+
const proc = await runLongLived("pnpm", "dev", projectPath);
148+
await vi.waitFor(
149+
async () => {
150+
expect(proc.stderr).toMatch(
151+
// Note: this error message shows that we're attempting to establish the remote proxy connection
152+
// using the "not-a-valid-account-id-abc" account id
153+
/A request to the Cloudflare API \(\/accounts\/not-a-valid-account-id-abc\/.*?\) failed/
154+
);
155+
},
156+
{
157+
timeout: 10_000,
158+
}
159+
);
160+
});
161+
});
140162
}
141163

142164
describe("remote bindings disabled", () => {
@@ -163,25 +185,3 @@ describe("remote bindings disabled", () => {
163185
);
164186
});
165187
});
166-
167-
describe("remote bindings without actually establishing a remote connection", () => {
168-
const projectPath = seed("remote-bindings-config-account-id", "pnpm");
169-
170-
test("for connection to remote bindings during dev the account_id present in the wrangler config file is used", async ({
171-
expect,
172-
}) => {
173-
const proc = await runLongLived("pnpm", "dev", projectPath);
174-
await vi.waitFor(
175-
async () => {
176-
expect(proc.stderr).toMatch(
177-
// Note: this error message shows that we're attempting to establish the remote proxy connection
178-
// using the "not-a-valid-account-id-abc" account id
179-
/A request to the Cloudflare API \(\/accounts\/not-a-valid-account-id-abc\/.*?\) failed/
180-
);
181-
},
182-
{
183-
timeout: 10_000,
184-
}
185-
);
186-
});
187-
});

0 commit comments

Comments
 (0)