Skip to content

Commit 710f7b0

Browse files
committed
test(e2e): replace key regex with presence checks in fixture setup
1 parent 7750d4a commit 710f7b0

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

test/e2e/lib/fixture-setup.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { expect } from "bun:test";
21
import { mkdtemp, cp, rm, realpath } from "node:fs/promises";
32
import { join } from "node:path";
43
import { tmpdir } from "node:os";
@@ -168,11 +167,15 @@ export async function setupFixture(name: FixtureName): Promise<Fixture> {
168167

169168
const publishableKeyName = await detectPublishableKeyName(projectDir);
170169
publishableKey = envVars[publishableKeyName] ?? "";
171-
expect(publishableKey).toMatch(/^pk_(test|live)_[a-z0-9]+$/);
170+
if (!publishableKey) {
171+
throw new Error(`${publishableKeyName} not found in env files written by clerk init.`);
172+
}
172173

173174
const secretKeyName = await detectSecretKeyName(projectDir);
174175
secretKey = envVars[secretKeyName] ?? "";
175-
expect(secretKey).toMatch(/^sk_(test|live)_[a-z0-9]+$/);
176+
if (!secretKey) {
177+
throw new Error(`${secretKeyName} not found in env files written by clerk init.`);
178+
}
176179

177180
const install = await Bun.$`npm ci --ignore-scripts --legacy-peer-deps`
178181
.cwd(projectDir)

0 commit comments

Comments
 (0)