Files
+3 bcd936335c feat: Environment API (#16471)
Co-authored-by: Hiroshi Ogawa <[email protected]>
Co-authored-by: Dario Piotrowicz <[email protected]>
Co-authored-by: Vladimir Sheremet <[email protected]>
Co-authored-by: Arnaud Barré <[email protected]>
Co-authored-by: Anthony Fu <[email protected]>
Co-authored-by: Dominik G <[email protected]>
Co-authored-by: Igor Minar <[email protected]>
Co-authored-by: Viktor Lázár <[email protected]>
Co-authored-by: Joaquín Sánchez <[email protected]>
Co-authored-by: sapphi-red <[email protected]>
Co-authored-by: bluwy <[email protected]>
2024-09-04 11:27:09 +02:00

13 lines
526 B
TypeScript

import { expect, test } from 'vitest'
import { isServe, page, viteServer } from '~utils'
test.runIf(isServe)('importedUrls order is preserved', async () => {
const el = page.locator('.imported-urls-order')
expect(await el.textContent()).toBe('[success]')
const mod = await viteServer.environments.client.moduleGraph.getModuleByUrl(
'/imported-urls-order.js',
)
const importedModuleIds = [...mod.importedModules].map((m) => m.url)
expect(importedModuleIds).toEqual(['\x00virtual:slow-module', '/empty.js'])
})