rsnext/test/unit/handles-incorrect-react.test.js
Joe Haddad 18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00

17 lines
599 B
JavaScript

/* eslint-env jest */
import path from 'path'
jest.mock('react', () => ({
Suspense: undefined,
}))
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 () => {
expect(() => require(nextBin)).toThrow(
/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 --save react react-dom" https:\/\/err\.sh/
)
})
})