Files
Zack TannerandGitHub b368a504a8 Fix Turbopack worker URL context lookup (#96307)
## Summary

- Preserve the original static worker request when generating the
Turbopack module-context lookup, instead of passing an already-rewritten
URL object.
- Adds an e2e fixture for bare-module Worker URLs with conditional
wildcard exports.

It looks like this might have regressed in #88602

Fixes #94015
Closes #94043 

## Verification

- `cargo check -p turbopack-ecmascript`
- `HEADLESS=true pnpm test-start-turbo
test/e2e/app-dir/worker-module-url/worker-module-url.test.ts`
- `HEADLESS=true pnpm test-start-webpack
test/e2e/app-dir/worker-module-url/worker-module-url.test.ts`
2026-07-28 11:48:17 -07:00

22 lines
613 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
import { retry } from 'next-test-utils'
describe('worker-module-url', () => {
const { next } = nextTestSetup({
files: __dirname,
dependencies: {
// Mirrors the conditional wildcard exports used by worker packages.
'worker-package': 'file:./worker-package',
},
})
it('should create a worker from a bare module URL', async () => {
const browser = await next.browser('/')
await browser.elementByCss('button').click()
await retry(async () => {
expect(await browser.elementById('status').text()).toBe('ready')
})
})
})