Skip to content

Commit

Permalink
Use retry helper instead
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Jan 10, 2024
1 parent 1e6bbab commit 13f87d0
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import { join } from 'path'
import {
check,
fetchViaHTTP,
File,
findPort,
killApp,
launchApp,
nextBuild,
nextStart,
retry,
waitFor,
} from 'next-test-utils'
import { remove } from 'fs-extra'
Expand Down Expand Up @@ -84,20 +84,22 @@ describe('Edge runtime configurable guards', () => {
const res = await fetchViaHTTP(context.appPort, middlewareUrl)
await waitFor(500)
expect(res.status).toBe(200)
await check(
() => context.logs.output,
/Dynamic Code Evaluation \(e\. g\. 'eval', 'new Function'\) not allowed in Edge Runtime/g
)
await retry(async () => {
expect(context.logs.output).toContain(
`Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Edge Runtime`
)
})
})

it('warns in dev for unallowed code', async () => {
context.app = await launchApp(context.appDir, context.appPort, appOption)
const res = await fetchViaHTTP(context.appPort, routeUrl)
expect(res.status).toBe(200)
await check(
() => context.logs.output,
/Dynamic Code Evaluation \(e\. g\. 'eval', 'new Function'\) not allowed in Edge Runtime/g
)
await retry(async () => {
expect(context.logs.output).toContain(
`Dynamic Code Evaluation (e. g. 'eval', 'new Function') not allowed in Edge Runtime`
)
})
})
;(process.env.TURBOPACK ? describe.skip : describe)(
'production mode',
Expand Down

0 comments on commit 13f87d0

Please sign in to comment.