-
Notifications
You must be signed in to change notification settings - Fork 56
/
setup.ts
27 lines (19 loc) · 812 Bytes
/
setup.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// https://mochajs.org/#global-fixtures
import assert from 'node:assert/strict'
import { rm } from 'node:fs/promises'
import { join } from 'node:path'
import { isFileExists } from '@waiting/shared-core'
import { testConfig } from '#@/root.config.js'
export async function mochaGlobalSetup(): Promise<void> {
void 0
}
export async function mochaGlobalTeardown(): Promise<void> {
void 0
const targetExists = await isFileExists(testConfig.startDocPrinterTargetFile)
console.log('startDocPrinterTargetFile: ', testConfig.startDocPrinterTargetFile)
assert(
targetExists === true,
`204.StartDocPrinter-EndDocPrinter.test.ts StartDocPrinter(): file not exists: ${testConfig.startDocPrinterTargetFile}`,
)
await rm(testConfig.startDocPrinterTargetFile, { force: true, recursive: false })
}