forked from vitejs/vite
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
external.spec.ts
25 lines (21 loc) · 960 Bytes
/
external.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { describe, expect, test } from 'vitest'
import { browserLogs, isBuild, page } from '~utils'
test('importmap', () => {
expect(browserLogs).not.toContain(
'An import map is added after module script load was triggered.'
)
})
test('should have default exports', async () => {
expect(await page.textContent('#imported-slash-exists')).toBe('true')
expect(await page.textContent('#required-slash-exists')).toBe('true')
})
describe.runIf(isBuild)('build', () => {
test('should externalize imported packages', async () => {
// If `vue` is successfully externalized, the page should use the version from the import map
expect(await page.textContent('#imported-vue-version')).toBe('3.2.0')
})
test('should externalize required packages', async () => {
// If `vue` is successfully externalized, the page should use the version from the import map
expect(await page.textContent('#required-vue-version')).toBe('3.2.0')
})
})