mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 06:05:11 +00:00
21 lines
488 B
TypeScript
21 lines
488 B
TypeScript
|
import { fileURLToPath } from 'node:url'
|
||
|
import { dirname, join } from 'node:path'
|
||
|
import fs from 'fs-extra'
|
||
|
|
||
|
const dir = dirname(fileURLToPath(import.meta.url))
|
||
|
const fixtureDir = join(dir, 'fixtures')
|
||
|
const tempDir = join(dir, 'fixtures-temp')
|
||
|
|
||
|
export async function setup () {
|
||
|
if (fs.existsSync(tempDir)) {
|
||
|
await fs.remove(tempDir)
|
||
|
}
|
||
|
await fs.copy(fixtureDir, tempDir)
|
||
|
}
|
||
|
|
||
|
export async function teardown () {
|
||
|
if (fs.existsSync(tempDir)) {
|
||
|
await fs.remove(tempDir)
|
||
|
}
|
||
|
}
|