Files
ComfyUI_frontend/browser_tests/globalSetupWithI18n.ts
snomiao 4c2715e480 refactor: Replace script-based litegraph preprocessing with integrated Playwright setup
- Remove prebuild-litegraph.js and restore-litegraph.js scripts
- Add i18nSetup.ts module for litegraph TypeScript 'declare' keyword preprocessing
- Create ComfyPageNoUser fixture to avoid user creation conflicts in i18n tests
- Update playwright.i18n.config.ts to use integrated setup/teardown
- Simplify collect-i18n command to just run Playwright tests
- Ensure pnpm collect-i18n works correctly

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 03:33:16 +00:00

30 lines
750 B
TypeScript

/**
* Combined global setup for i18n collection tests
* Includes both regular setup and litegraph preprocessing
*/
import globalSetup from './globalSetup'
import { preprocessLitegraph } from './i18nSetup'
export default async function globalSetupWithI18n() {
// First preprocess litegraph files
await preprocessLitegraph()
// Then run regular global setup
await globalSetup()
// Register cleanup handlers
const cleanup = async () => {
const { restoreLitegraph } = await import('./i18nSetup')
await restoreLitegraph()
}
process.on('exit', cleanup)
process.on('SIGINT', async () => {
await cleanup()
process.exit(0)
})
process.on('SIGTERM', async () => {
await cleanup()
process.exit(0)
})
}