mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-11-09 20:07:43 +08:00
test(docs): avoid duplicate fixture cleanup
This commit is contained in:
@@ -3,18 +3,12 @@
|
||||
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { dirname, join } from 'node:path'
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
import { describe, expect, it, onTestFinished } from 'vitest'
|
||||
import { auditSubsystemPages } from './verify-subsystem-pages.ts'
|
||||
|
||||
const roots: string[] = []
|
||||
|
||||
afterEach(() => {
|
||||
for (const root of roots.splice(0)) rmSync(root, { recursive: true, force: true })
|
||||
})
|
||||
|
||||
function fixture(): string {
|
||||
const root = mkdtempSync(join(tmpdir(), 'dsh-subsystem-pages-'))
|
||||
roots.push(root)
|
||||
onTestFinished(() => rmSync(root, { recursive: true, force: true }))
|
||||
return root
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user