Skip to content

Commit daeddef

Browse files
assert that the cloudflare:preview script is defined
1 parent 0b0cb33 commit daeddef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

apps/site/playwright.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { defineConfig, devices, type Config } from '@playwright/test';
22

3+
import json from './package.json' with { type: 'json' };
4+
35
const isCI = !!process.env.CI;
46

57
// https://playwright.dev/docs/test-configuration
@@ -32,6 +34,10 @@ export default defineConfig({
3234
});
3335

3436
function getWebServerConfig(): Pick<Config, 'webServer'> {
37+
if (!json.scripts['cloudflare:preview']) {
38+
throw new Error('cloudflare:preview script not defined');
39+
}
40+
3541
if (process.env.PLAYWRIGHT_RUN_CLOUDFLARE_PREVIEW) {
3642
return {
3743
webServer: {

0 commit comments

Comments
 (0)