Skip to content

Commit c2f5a40

Browse files
committed
test: define compile-time globals for Playwright collection
main added an eager isCloud import to StorageKeys, which the custom-node fixtures import in Playwright's Node collection process. Vite replaces __DISTRIBUTION__ in browser bundles but nothing defined it under Node, so every spec aborted before collection. Mirror vite.config.mts's derivation at config load, the same way vitest.setup.ts already does.
1 parent 2f67d21 commit c2f5a40

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

playwright.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
import type { PlaywrightTestConfig } from '@playwright/test'
22
import { defineConfig, devices } from '@playwright/test'
33

4+
const distribution = process.env.DISTRIBUTION
5+
Object.assign(globalThis, {
6+
__DISTRIBUTION__:
7+
distribution === 'desktop' ||
8+
distribution === 'localhost' ||
9+
distribution === 'cloud'
10+
? distribution
11+
: process.env.DEV_SERVER_COMFYUI_URL?.includes('.comfy.org')
12+
? 'cloud'
13+
: 'localhost',
14+
__IS_NIGHTLY__: process.env.IS_NIGHTLY === 'true'
15+
})
16+
417
const maybeLocalOptions: PlaywrightTestConfig = process.env.PLAYWRIGHT_LOCAL
518
? {
619
timeout: 30_000,

0 commit comments

Comments
 (0)