2019-04-04 23:47:17 +02:00
/* eslint-env jest */
import path from 'path'
jest . mock ( 'react' , ( ) => ( {
2019-11-11 04:24:53 +01:00
Suspense : undefined ,
2019-04-04 23:47:17 +02:00
} ) )
const nextDir = path . dirname ( require . resolve ( 'next/package' ) )
const nextBin = path . join ( nextDir , 'dist/bin/next' )
describe ( 'Handles Incorrect React Version' , ( ) => {
it ( 'should throw an error when building with next' , async ( ) => {
2019-05-30 03:19:32 +02:00
expect ( ( ) => require ( nextBin ) ) . toThrow (
2020-01-27 14:35:12 +01:00
/The version of React you are using is lower than the minimum required version needed for Next\.js\. Please upgrade "react" and "react-dom": "npm install react react-dom" https:\/\/err\.sh/
2019-05-30 03:19:32 +02:00
)
2019-04-04 23:47:17 +02:00
} )
} )