Skip to content

Commit

Permalink
test: test shared chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Dec 9, 2024
1 parent 2975480 commit 335d853
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions playground/rolldown-dev-mpa/__tests__/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import { test } from 'vitest'
import { page } from '../../test-utils'

test('basic', async () => {
page.setDefaultTimeout(1000)
await page.getByRole('heading', { name: 'Home' }).click()
await page.getByText('Rendered by /index.js').click()
await page.getByText('shared: [ok]').click()
await page.getByRole('link', { name: 'About' }).click()
await page.waitForURL(/\/about/)
await page.getByRole('heading', { name: 'About' }).click()
await page.getByText('Rendered by /about/index.js').click()
await page.getByText('shared: [ok]').click()
})
3 changes: 3 additions & 0 deletions playground/rolldown-dev-mpa/about/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import shared from '../shared'

document.getElementById('root').innerHTML = `
<p>Rendered by /about/index.js: ${Math.random().toString(36).slice(2)}</p>
<pre>shared: ${shared}</pre>
`
3 changes: 3 additions & 0 deletions playground/rolldown-dev-mpa/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import shared from './shared'

document.getElementById('root').innerHTML = `
<p>Rendered by /index.js: ${Math.random().toString(36).slice(2)}</p>
<pre>shared: ${shared}</pre>
`
1 change: 1 addition & 0 deletions playground/rolldown-dev-mpa/shared.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default '[ok]'

0 comments on commit 335d853

Please sign in to comment.