mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
They were failing. Sam will look into these - https://github.com/vercel/next.js/actions/runs/28831699621/job/85515363343 - https://github.com/vercel/next.js/actions/runs/28831699621/job/85515363453 - https://github.com/vercel/next.js/actions/runs/28831699621/job/85515363420
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
import { retry } from 'next-test-utils'
|
|
|
|
// Compiling `navigator.serviceWorker.register(new URL(...))` is a Turbopack-only feature.
|
|
;(process.env.IS_TURBOPACK_TEST ? describe : describe.skip)(
|
|
'app dir - service worker (multiple registrations error)',
|
|
() => {
|
|
const { next, skipped, isNextDev } = nextTestSetup({
|
|
files: __dirname,
|
|
skipStart: true,
|
|
// This test asserts a build failure.
|
|
skipDeployment: true,
|
|
})
|
|
|
|
if (skipped) {
|
|
return
|
|
}
|
|
|
|
it('errors when different service worker files are registered', async () => {
|
|
// In production `next.start()` runs the build, which fails. In dev the server
|
|
// boots and the failure surfaces when the registering page is compiled.
|
|
await next.start().catch(() => {})
|
|
if (isNextDev) {
|
|
await next.fetch('/').catch(() => {})
|
|
}
|
|
|
|
await retry(async () => {
|
|
expect(next.cliOutput).toContain(
|
|
'Multiple service workers with different source files'
|
|
)
|
|
})
|
|
})
|
|
}
|
|
)
|