mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
## 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]>
23 lines
731 B
TypeScript
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./
|
|
)
|
|
})
|
|
}
|
|
)
|