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 7c53ede commit d88a411
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion playground/rolldown-dev-mpa/__tests__/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ test('basic', async () => {
await page.goto('/')
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/src/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/src/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/src/shared.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default '[ok]'

0 comments on commit d88a411

Please sign in to comment.