- 将 playwright.config.ts 的 mkdtemp 替换为固定路径,解决主进程/worker 临时目录不一致问题 - 交换后端 WAL 与迁移执行顺序,确保 sql.js 能读取到完整 schema - 修复 models.spec.ts 断言使用 exact:true 避免统一模型 ID 列干扰 - 移除全部 10 个 test.skip,26 个 E2E 测试全部通过
19 lines
512 B
TypeScript
19 lines
512 B
TypeScript
import fs from 'node:fs'
|
|
import os from 'node:os'
|
|
import path from 'node:path'
|
|
|
|
async function globalTeardown() {
|
|
const tempDir = path.join(os.tmpdir(), 'nex-e2e')
|
|
if (fs.existsSync(tempDir)) {
|
|
await new Promise((resolve) => setTimeout(resolve, 500))
|
|
try {
|
|
fs.rmSync(tempDir, { recursive: true, force: true })
|
|
console.log(`Cleaned up E2E temp dir: ${tempDir}`)
|
|
} catch (e) {
|
|
console.error(`Failed to clean up temp dir ${tempDir}:`, e)
|
|
}
|
|
}
|
|
}
|
|
|
|
export default globalTeardown
|