Skip to content

Commit 7995bd1

Browse files
committed
test: clear the font cache of every fixture and playground
1 parent f5a6ae4 commit 7995bd1

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎test/setup.ts‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { promises as fsp } from 'node:fs'
22

3+
import { glob } from 'tinyglobby'
4+
35
import { cacheBase } from '../src/cache'
46

57
export async function setup() {
6-
await fsp.rm('./' + cacheBase, { recursive: true, force: true })
7-
for (const dir of ['basic', 'nuxt5', 'scss', 'tailwindcss', 'unocss']) {
8-
await fsp.rm('./playgrounds/' + dir + '/' + cacheBase, { recursive: true, force: true })
8+
const caches = await glob([cacheBase, `{playgrounds,test/fixtures}/*/${cacheBase}`], {
9+
onlyDirectories: true,
10+
absolute: true,
11+
})
12+
for (const cache of caches) {
13+
await fsp.rm(cache, { recursive: true, force: true })
914
}
1015
console.log('✅ Cleared font cache.')
1116
}

0 commit comments

Comments
 (0)