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
9f194677
Commit
9f194677
authored
May 09, 2017
by
Brikou CARRE
Committed by
Arunoda Susiripala
May 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade jest and simplify .babelrc (#1913)
* Upgrade jest and simplify .babelrc * Fix linter
parent
6ff40c3c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
21 deletions
+24
-21
.babelrc
examples/with-jest/.babelrc
+6
-5
index.test.js.snap
...ples/with-jest/__tests__/__snapshots__/index.test.js.snap
+6
-2
index.test.js
examples/with-jest/__tests__/index.test.js
+4
-5
package.json
examples/with-jest/package.json
+8
-9
No files found.
examples/with-jest/.babelrc
View file @
9f194677
{
"env": {
"development": {
"presets":
["next/babel"]
"presets":
"next/babel"
},
"production": {
"presets":
["next/babel"]
"presets":
"next/babel"
},
"test": {
// next/babel does not transpile import/export syntax.
// So, using es2015 in the beginning will fix that.
"presets": ["es2015", "next/babel"]
"presets": [
["env", { "modules": "commonjs" }],
"next/babel"
]
}
}
}
examples/with-jest/__tests__/__snapshots__/index.test.js.snap
View file @
9f194677
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`With Snapshot Testing App shows "Hello world!" 1`] = `
<div
data-jsx={2648947580}>
data-jsx={2648947580}
>
<p
data-jsx={2648947580}>
data-jsx={2648947580}
>
Hello World!
</p>
</div>
...
...
examples/with-jest/__tests__/index.test.js
View file @
9f194677
/*
global it, expect, describe
*/
/*
eslint-env jest
*/
import
React
from
'react'
import
{
shallow
}
from
'enzyme'
import
React
from
'react'
import
renderer
from
'react-test-renderer'
import
App
from
'../pages/index.js'
describe
(
'With Enzyme'
,
()
=>
{
it
(
'App shows "Hello world!"'
,
()
=>
{
const
app
=
shallow
(
<
App
/>
)
const
app
=
shallow
(
<
App
/>
)
expect
(
app
.
find
(
'p'
).
text
()).
toEqual
(
'Hello World!'
)
})
...
...
examples/with-jest/package.json
View file @
9f194677
...
...
@@ -2,20 +2,19 @@
"name"
:
"with-jest"
,
"dependencies"
:
{
"next"
:
"latest"
,
"react"
:
"^15.4.2"
,
"react-dom"
:
"^15.4.2"
"react"
:
"^15.5.4"
,
"react-dom"
:
"^15.5.4"
},
"devDependencies"
:
{
"enzyme"
:
"^2.8.2"
,
"jest"
:
"^20.0.0"
,
"react-addons-test-utils"
:
"^15.5.1"
,
"react-test-renderer"
:
"^15.5.4"
},
"scripts"
:
{
"test"
:
"jest"
,
"dev"
:
"next"
,
"build"
:
"next build"
,
"start"
:
"next start"
},
"devDependencies"
:
{
"enzyme"
:
"^2.5.1"
,
"jest-cli"
:
"^18.0.0"
,
"react-addons-test-utils"
:
"^15.4.2"
,
"babel-preset-es2015"
:
"^6.22.0"
,
"react-test-renderer"
:
"^15.4.2"
}
}
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