Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
25005d15
Commit
25005d15
authored
Dec 05, 2017
by
Brice BERNARD
Committed by
Tim Neutkens
Dec 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[with-jest] Fix tests (#3395)
* Fix tests * Follow linting rules
parent
e8f39ad7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
25 deletions
+25
-25
.babelrc
examples/with-jest/.babelrc
+3
-6
index.test.js.snap
...ples/with-jest/__tests__/__snapshots__/index.test.js.snap
+3
-3
jest.config.js
examples/with-jest/jest.config.js
+4
-0
jest.setup.js
examples/with-jest/jest.setup.js
+5
-0
package.json
examples/with-jest/package.json
+10
-13
shim.js
examples/with-jest/shim.js
+0
-3
No files found.
examples/with-jest/.babelrc
View file @
25005d15
{
"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"]
}
}
}
examples/with-jest/__tests__/__snapshots__/index.test.js.snap
View file @
25005d15
...
...
@@ -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>
`
;
`
examples/with-jest/jest.config.js
0 → 100644
View file @
25005d15
module
.
exports
=
{
setupFiles
:
[
'<rootDir>/jest.setup.js'
],
testPathIgnorePatterns
:
[
'<rootDir>/.next/'
,
'<rootDir>/node_modules/'
]
}
examples/with-jest/jest.setup.js
0 → 100644
View file @
25005d15
import
'raf/polyfill'
import
{
configure
}
from
'enzyme'
import
Adapter
from
'enzyme-adapter-react-16'
configure
({
adapter
:
new
Adapter
()
})
examples/with-jest/package.json
View file @
25005d15
{
"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"
}
}
\ No newline at end of file
}
examples/with-jest/shim.js
deleted
100644 → 0
View file @
e8f39ad7
global
.
requestAnimationFrame
=
callback
=>
{
setTimeout
(
callback
,
0
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment