Skip to content

Commit

Permalink
fix middleware-error test
Browse files Browse the repository at this point in the history
  • Loading branch information
gaojude committed Nov 4, 2024
1 parent 5e06f9b commit f2b44af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/development/middleware-errors/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('middleware - development errors', () => {
const browser = await next.browser('/')
await assertHasRedbox(browser)
await next.patchFile('middleware.js', `export default function () {}`)
await assertHasRedbox(browser)
await assertNoRedbox(browser)
})
})

Expand Down Expand Up @@ -160,7 +160,7 @@ describe('middleware - development errors', () => {
await assertHasRedbox(browser)
expect(await getRedboxSource(browser)).toContain(`eval('test')`)
await next.patchFile('middleware.js', `export default function () {}`)
await assertHasRedbox(browser)
await assertNoRedbox(browser)
})
})

Expand Down Expand Up @@ -207,7 +207,7 @@ describe('middleware - development errors', () => {
expect(source).toContain('middleware.js')
expect(source).not.toContain('//middleware.js')
await next.patchFile('middleware.js', `export default function () {}`)
await assertHasRedbox(browser)
await assertNoRedbox(browser)
})
})

Expand Down Expand Up @@ -311,7 +311,7 @@ describe('middleware - development errors', () => {
await browser.elementByCss('#nextjs__container_errors_desc').text()
).toEqual('Failed to compile')
await next.patchFile('middleware.js', `export default function () {}`)
await assertHasRedbox(browser)
await assertNoRedbox(browser)
expect(await browser.elementByCss('#page-title')).toBeTruthy()
})
})
Expand Down

0 comments on commit f2b44af

Please sign in to comment.