File size: 456 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { nextTestSetup } from 'e2e-utils'
import { check } from 'next-test-utils'

describe('ENOENT during require', () => {
  const { next } = nextTestSetup({
    files: __dirname,
  })

  it('should show ENOENT error correctly', async () => {
    await next.fetch('/')

    await check(() => {
      expect(next.cliOutput).toContain(
        "ENOENT: no such file or directory, open 'does-not-exist.txt'"
      )
      return 'yes'
    }, 'yes')
  })
})