rsnext/test/production/next-font/babel-unsupported.test.ts
2024-04-09 00:25:43 +02:00

24 lines
690 B
TypeScript

import { createNext, FileRef } from 'e2e-utils'
import { NextInstance } from 'e2e-utils'
import { join } from 'path'
describe('@next/fon babel unsupported', () => {
let next: NextInstance
beforeAll(async () => {
next = await createNext({
skipStart: true,
files: new FileRef(join(__dirname, 'babel-unsupported')),
})
})
afterAll(() => next.destroy())
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./
)
})
})