mirror of
https://github.com/hanzoai/vite.git
synced 2026-10-30 19:36:16 +00:00
18 lines
587 B
TypeScript
18 lines
587 B
TypeScript
import { describe, expect, test } from 'vitest'
|
|
import { getColor, isBuild, listAssets } from '~utils'
|
|
|
|
test('should load all stylesheets', async () => {
|
|
expect(await getColor('.shared-linked')).toBe('blue')
|
|
await expect.poll(() => getColor('.async-js')).toBe('blue')
|
|
})
|
|
|
|
describe.runIf(isBuild)('build', () => {
|
|
test('should remove empty chunk', async () => {
|
|
const assets = listAssets()
|
|
expect(assets).not.toContainEqual(
|
|
expect.stringMatching(/shared-linked-.*\.js$/),
|
|
)
|
|
expect(assets).not.toContainEqual(expect.stringMatching(/async-js-.*\.js$/))
|
|
})
|
|
})
|