mirror of
https://github.com/hanzoai/vite.git
synced 2026-10-30 19:36:16 +00:00
15 lines
538 B
TypeScript
15 lines
538 B
TypeScript
import { expect, test } from 'vitest'
|
|
import { getBg, isBuild, page, viteTestUrl } from '~utils'
|
|
import './tests'
|
|
|
|
// not included in tests.ts because the lightningcss variant does not use
|
|
// the postcss pipeline
|
|
test('postcss plugin that injects url() at OnceExit', async () => {
|
|
await page.goto(viteTestUrl)
|
|
const imported = await page.$('.inject-url-once-exit')
|
|
// url should be rebased against the injected source file
|
|
expect(await getBg(imported)).toMatch(
|
|
isBuild ? /base64/ : '/injected-source/injected-bg.png',
|
|
)
|
|
})
|