mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
parent
e8f39ad74c
commit
25005d158b
|
@ -1,16 +1,13 @@
|
||||||
{
|
{
|
||||||
"env": {
|
"env": {
|
||||||
"development": {
|
"development": {
|
||||||
"presets": "next/babel"
|
"presets": ["next/babel"]
|
||||||
},
|
},
|
||||||
"production": {
|
"production": {
|
||||||
"presets": "next/babel"
|
"presets": ["next/babel"]
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"presets": [
|
"presets": [["env", { "modules": "commonjs" }], "next/babel"]
|
||||||
["env", { "modules": "commonjs" }],
|
|
||||||
"next/babel"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
exports[`With Snapshot Testing App shows "Hello world!" 1`] = `
|
exports[`With Snapshot Testing App shows "Hello world!" 1`] = `
|
||||||
<div
|
<div
|
||||||
data-jsx={2648947580}
|
className="jsx-2982525546"
|
||||||
>
|
>
|
||||||
<p
|
<p
|
||||||
data-jsx={2648947580}
|
className="jsx-2982525546"
|
||||||
>
|
>
|
||||||
Hello World!
|
Hello World!
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`
|
||||||
|
|
4
examples/with-jest/jest.config.js
Normal file
4
examples/with-jest/jest.config.js
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
module.exports = {
|
||||||
|
setupFiles: ['<rootDir>/jest.setup.js'],
|
||||||
|
testPathIgnorePatterns: ['<rootDir>/.next/', '<rootDir>/node_modules/']
|
||||||
|
}
|
5
examples/with-jest/jest.setup.js
Normal file
5
examples/with-jest/jest.setup.js
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
import 'raf/polyfill'
|
||||||
|
import { configure } from 'enzyme'
|
||||||
|
import Adapter from 'enzyme-adapter-react-16'
|
||||||
|
|
||||||
|
configure({ adapter: new Adapter() })
|
|
@ -1,24 +1,21 @@
|
||||||
{
|
{
|
||||||
"name": "with-jest",
|
"name": "with-jest",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"jest": {
|
|
||||||
"setupFiles": [
|
|
||||||
"<rootDir>/shim.js"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"next": "latest",
|
"next": "latest",
|
||||||
"react": "^16.0.0",
|
"react": "16.2.0",
|
||||||
"react-dom": "^16.0.0"
|
"react-dom": "16.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"enzyme": "^2.8.2",
|
"enzyme": "3.2.0",
|
||||||
"jest": "^21.0.0",
|
"enzyme-adapter-react-16": "1.1.0",
|
||||||
"react-addons-test-utils": "^15.6.0",
|
"jest": "21.2.1",
|
||||||
"react-test-renderer": "^16.0.0"
|
"raf": "3.4.0",
|
||||||
|
"react-addons-test-utils": "15.6.2",
|
||||||
|
"react-test-renderer": "16.2.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest",
|
"test": "NODE_ENV=test jest",
|
||||||
"dev": "next",
|
"dev": "next",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start"
|
"start": "next start"
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
global.requestAnimationFrame = callback => {
|
|
||||||
setTimeout(callback, 0)
|
|
||||||
}
|
|
Loading…
Reference in a new issue