File size: 868 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { createNext, FileRef } from 'e2e-utils'
import { NextInstance } 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',
  () => {
    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./
      )
    })
  }
)