Skip to content

Commit

Permalink
Update e2e test for app-dir edge (#42015)
Browse files Browse the repository at this point in the history
This is pending changes upstream so skips for now.

Fixes:
https://github.com/vercel/next.js/actions/runs/3335334239/jobs/5520286646
  • Loading branch information
ijjk committed Oct 27, 2022
1 parent 4b00495 commit 1b2e61c
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions test/e2e/app-dir/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,36 @@ describe('app dir', () => {
})
afterAll(() => next.destroy())

it('should not share edge workers', async () => {
const controller1 = new AbortController()
const controller2 = new AbortController()
fetchViaHTTP(next.url, '/slow-page-no-loading', undefined, {
signal: controller1.signal,
}).catch(() => {})
fetchViaHTTP(next.url, '/slow-page-no-loading', undefined, {
signal: controller2.signal,
}).catch(() => {})

await waitFor(1000)
controller1.abort()

const controller3 = new AbortController()
fetchViaHTTP(next.url, '/slow-page-no-loading', undefined, {
signal: controller3.signal,
}).catch(() => {})
await waitFor(1000)
controller2.abort()
controller3.abort()

const res = await fetchViaHTTP(next.url, '/slow-page-no-loading')
expect(res.status).toBe(200)
expect(await res.text()).toContain('hello from slow page')
expect(next.cliOutput).not.toContain(
'A separate worker must be used for each render'
)
})
if (!(global as any).isNextDeploy) {
it('should not share edge workers', async () => {
const controller1 = new AbortController()
const controller2 = new AbortController()
fetchViaHTTP(next.url, '/slow-page-no-loading', undefined, {
signal: controller1.signal,
}).catch(() => {})
fetchViaHTTP(next.url, '/slow-page-no-loading', undefined, {
signal: controller2.signal,
}).catch(() => {})

await waitFor(1000)
controller1.abort()

const controller3 = new AbortController()
fetchViaHTTP(next.url, '/slow-page-no-loading', undefined, {
signal: controller3.signal,
}).catch(() => {})
await waitFor(1000)
controller2.abort()
controller3.abort()

const res = await fetchViaHTTP(next.url, '/slow-page-no-loading')
expect(res.status).toBe(200)
expect(await res.text()).toContain('hello from slow page')
expect(next.cliOutput).not.toContain(
'A separate worker must be used for each render'
)
})
}

if ((global as any).isNextStart) {
it('should generate build traces correctly', async () => {
Expand Down

0 comments on commit 1b2e61c

Please sign in to comment.