Files
next.js/test/production/next-font/babel-unsupported.test.ts
4588a73542 Convert tests using createNext -> nextTestSetup (#93767)
## What?

Converts existing `createNext()` usage into `nextTestSetup()`. 

`createNext()` was the setup step we had before `nextTestSetup()` was
added.

This PR focused on the simple conversion cases. There will be a
follow-up to complete the last few.

---------

Co-authored-by: Cursor <[email protected]>
2026-05-12 13:16:31 +02:00

23 lines
731 B
TypeScript

import { FileRef, nextTestSetup } from 'e2e-utils'
import { join } from 'path'
// Turbopack does not support `.babelrc`. So this test is not relevant for Turbopack.
;(process.env.IS_TURBOPACK_TEST ? describe.skip : describe)(
'@next/font babel unsupported',
() => {
const { next } = nextTestSetup({
skipStart: true,
files: new FileRef(join(__dirname, 'babel-unsupported')),
})
test('Build error when using babel', async () => {
await expect(next.start()).rejects.toThrow(
'next build failed with code/signal 1'
)
expect(next.cliOutput).toMatch(
/"next\/font" requires SWC although Babel is being used due to a custom babel config being present./
)
})
}
)