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
+5 -2
View File
@@ -71,8 +71,11 @@ export class TestDataCleaner {
static clearCookies(): void {
if (typeof document !== 'undefined' && document.cookie) {
document.cookie.split(';').forEach(cookie => {
const name = cookie.split('=')[0].trim();
document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`;
const parts = cookie.split('=');
const name = parts[0]?.trim();
if (name) {
document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`;
}
});
}
}