-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathIsomorphicImport.test.js
More file actions
31 lines (26 loc) · 1.16 KB
/
IsomorphicImport.test.js
File metadata and controls
31 lines (26 loc) · 1.16 KB
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
26
27
28
29
30
31
describe('IsomorphicImport', () => {
beforeEach(async () => {
await page.goto('http://localhost:6969/isomorphic-import')
await page.waitForSelector('[data-hydrated]')
})
test('isomorphic imports used in the client stay in the client bundle', async () => {
const element = await page.$('[data-client-only]')
expect(element).toBeTruthy()
})
test('isomorphic aliased imports used in the client stay in the client bundle', async () => {
const element = await page.$('[data-client-only-alias]')
expect(element).toBeTruthy()
})
test('isomorphic imports used in the server only are removed from the client bundle', async () => {
const element = await page.$('[data-server-only]')
expect(element).toBeTruthy()
})
test('isomorphic aliased imports used in the server only are removed from the client bundle', async () => {
const element = await page.$('[data-server-only-alias]')
expect(element).toBeTruthy()
})
test('isomorphic namespaced imports used in the server only are removed from the client bundle', async () => {
const element = await page.$('[data-namespaced-server-only]')
expect(element).toBeTruthy()
})
})