fix(ts): 修复TypeScript类型错误
ci/woodpecker/push/woodpecker Pipeline failed

1. playwright.config.ts:
   - 添加类型断言 'fast' | 'standard' | 'deep'
   - 为tierConfig添加明确的Record类型
   - 移除不必要的fallback

2. test-data-cleaner.ts:
   - 修复Object is possibly 'undefined'错误
   - 添加可选链和空值检查
This commit is contained in:
张翔
2026-03-29 14:32:33 +08:00
parent 261742b15c
commit e0ca8235c8
2 changed files with 12 additions and 5 deletions
+7 -3
View File
@@ -1,10 +1,14 @@
import { defineConfig, devices } from '@playwright/test';
const isCI = !!process.env.CI;
const testTier = process.env.TEST_TIER || 'standard';
const testTier = (process.env.TEST_TIER || 'standard') as 'fast' | 'standard' | 'deep';
const baseURL = process.env.BASE_URL || (isCI ? 'http://localhost:3000' : 'https://novalon.cn');
const tierConfig = {
const tierConfig: Record<'fast' | 'standard' | 'deep', {
timeout: number;
retries: number;
workers: number | undefined;
}> = {
fast: {
timeout: 15000,
retries: 0,
@@ -22,7 +26,7 @@ const tierConfig = {
},
};
const config = tierConfig[testTier] || tierConfig.standard;
const config = tierConfig[testTier];
export default defineConfig({
testDir: './e2e',