Skip to content

Commit

Permalink
test: use globSync (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Feb 16, 2025
1 parent 4773f94 commit 1f3d89f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions playground/config-no-runtime-in-build/__tests__/test.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import { glob } from 'tinyglobby'
import { globSync } from 'tinyglobby'
import path from 'path'
import { describe, expect, it } from 'vitest'

Expand All @@ -9,7 +9,9 @@ describe('config-no-runtime-code-in-build', () => {
describe.runIf(isBuild)('build', () => {
it('should not contain plugin code in build artifacts', async () => {
await sleepForServerReady()
for await (const file of await glob(path.resolve(testDir, 'dist'), { onlyFiles: true })) {
const files = globSync('**', { cwd: path.resolve(testDir, 'dist'), absolute: true, onlyFiles: true })
expect(files.length).toBeGreaterThan(1)
for await (const file of files) {
const content = await fs.promises.readFile(file, 'utf-8')
expect(content).not.toContain('vite-plugin-checker')
}
Expand Down

0 comments on commit 1f3d89f

Please sign in to comment.