Skip to content

Commit cb131b7

Browse files
committed
Use fdir in test prepare script
1 parent 70d5bb6 commit cb131b7

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

packages/tailwindcss-language-server/tests/prepare.mjs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,26 @@ import { exec } from 'node:child_process'
22
import * as path from 'node:path'
33
import { fileURLToPath } from 'node:url'
44
import { promisify } from 'node:util'
5-
import glob from 'fast-glob'
5+
import { fdir } from 'fdir'
66

77
const __dirname = path.dirname(fileURLToPath(import.meta.url))
88

9-
const fixtures = glob.sync(['tests/fixtures/*/package.json', 'tests/fixtures/v4/*/package.json'], {
10-
cwd: path.resolve(__dirname, '..'),
11-
})
9+
const root = path.resolve(__dirname, '..')
10+
11+
const fixtures = new fdir()
12+
.withFullPaths()
13+
.globWithOptions([`tests/fixtures/*/package.json`, `tests/fixtures/v4/*/package.json`], {
14+
strictSlashes: true,
15+
contains: true,
16+
})
17+
.crawl(path.resolve(root, 'tests'))
18+
.sync()
1219

1320
const execAsync = promisify(exec)
1421

1522
await Promise.all(
1623
fixtures.map(async (fixture) => {
17-
console.log(`Installing dependencies for ${fixture}`)
24+
console.log(`Installing dependencies for ${path.relative(root, fixture)}`)
1825

1926
await execAsync('npm install', { cwd: path.dirname(fixture) })
2027
}),

0 commit comments

Comments
 (0)