mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 18:13:54 +00:00
26 lines
639 B
TypeScript
26 lines
639 B
TypeScript
import { fileURLToPath } from 'node:url'
|
|
import { globby } from 'globby'
|
|
import fs from 'fs-extra'
|
|
import { execa } from 'execa'
|
|
|
|
async function initTesting () {
|
|
const dirs = await globby('*', {
|
|
onlyDirectories: true,
|
|
cwd: fileURLToPath(new URL('./fixtures', import.meta.url)),
|
|
absolute: true
|
|
})
|
|
|
|
await Promise.all([
|
|
// clear nuxt build files
|
|
...dirs.map(dir => fs.remove(`${dir}/.nuxt`)),
|
|
// clear vite cache
|
|
...dirs.map(dir => fs.remove(`${dir}/node_modules/.cache`), { force: true })
|
|
])
|
|
|
|
await Promise.all(
|
|
dirs.map(dir => execa('pnpm', ['nuxi', 'prepare'], { cwd: dir }))
|
|
)
|
|
}
|
|
|
|
initTesting()
|