Skip to content

Commit e0f1588

Browse files
committed
chore: fix test
1 parent 97c3967 commit e0f1588

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

playground/nuxt3/nuxt3.test.ts

+9-16
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,16 @@ describe('nuxt3', () => {
99
// Note: this is a hacky solution
1010
await execa('pnpm', ['build'], { cwd: __dirname })
1111

12-
const globDir = path.join(__dirname, '.output', 'public', '_nuxt')
13-
14-
const cssFiles = await globby('*.css', {
15-
cwd: globDir,
16-
followSymbolicLinks: true,
17-
})
18-
12+
const html = path.join(__dirname, '.output', 'public', 'index.html')
13+
const htmlStyleBlocks = fs.readFileSync(html, 'utf-8').match(/<style>([\s\S]*?)<\/style>/g)
1914
let foundAttributify = false
20-
cssFiles
21-
.map(f => fs.readFileSync(path.join(globDir, f), 'utf-8'))
22-
.forEach((css) => {
23-
if (!foundAttributify && css.includes('[bg~='))
24-
foundAttributify = true
25-
// importing scss @apply transforms is broken
26-
if (!css.includes('.test-apply'))
27-
expect(css).not.toContain('@apply')
28-
})
15+
htmlStyleBlocks.forEach((css) => {
16+
if (!foundAttributify && css.includes('[bg~='))
17+
foundAttributify = true
18+
// importing scss @apply transforms is broken
19+
if (!css.includes('.test-apply'))
20+
expect(css).not.toContain('@apply')
21+
})
2922
expect(foundAttributify).toBeTruthy()
3023
})
3124
})

0 commit comments

Comments
 (0)