1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

[with-jest] Fix tests (#3395)

* Fix tests

* Follow linting rules
This commit is contained in:
Brice BERNARD 2017-12-05 19:43:30 +01:00 committed by Tim Neutkens
parent e8f39ad74c
commit 25005d158b
6 changed files with 25 additions and 25 deletions

View file

@ -1,16 +1,13 @@
{
"env": {
"development": {
"presets": "next/babel"
"presets": ["next/babel"]
},
"production": {
"presets": "next/babel"
"presets": ["next/babel"]
},
"test": {
"presets": [
["env", { "modules": "commonjs" }],
"next/babel"
]
"presets": [["env", { "modules": "commonjs" }], "next/babel"]
}
}
}

View file

@ -2,12 +2,12 @@
exports[`With Snapshot Testing App shows "Hello world!" 1`] = `
<div
data-jsx={2648947580}
className="jsx-2982525546"
>
<p
data-jsx={2648947580}
className="jsx-2982525546"
>
Hello World!
</p>
</div>
`;
`

View file

@ -0,0 +1,4 @@
module.exports = {
setupFiles: ['<rootDir>/jest.setup.js'],
testPathIgnorePatterns: ['<rootDir>/.next/', '<rootDir>/node_modules/']
}

View file

@ -0,0 +1,5 @@
import 'raf/polyfill'
import { configure } from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
configure({ adapter: new Adapter() })

View file

@ -1,26 +1,23 @@
{
"name": "with-jest",
"version": "1.0.0",
"jest": {
"setupFiles": [
"<rootDir>/shim.js"
]
},
"dependencies": {
"next": "latest",
"react": "^16.0.0",
"react-dom": "^16.0.0"
"react": "16.2.0",
"react-dom": "16.2.0"
},
"devDependencies": {
"enzyme": "^2.8.2",
"jest": "^21.0.0",
"react-addons-test-utils": "^15.6.0",
"react-test-renderer": "^16.0.0"
"enzyme": "3.2.0",
"enzyme-adapter-react-16": "1.1.0",
"jest": "21.2.1",
"raf": "3.4.0",
"react-addons-test-utils": "15.6.2",
"react-test-renderer": "16.2.0"
},
"scripts": {
"test": "jest",
"test": "NODE_ENV=test jest",
"dev": "next",
"build": "next build",
"start": "next start"
}
}
}

View file

@ -1,3 +0,0 @@
global.requestAnimationFrame = callback => {
setTimeout(callback, 0)
}