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
85fd832e
Commit
85fd832e
authored
Jan 02, 2019
by
Niklas Wagner
Committed by
Tim Neutkens
Jan 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rtl-test example & add Snapshot testing (#5981)
parent
fd3cb2a1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
index.test.js.snap
...esting-library/__tests__/__snapshots__/index.test.js.snap
+11
-0
index.test.js
...s/with-jest-react-testing-library/__tests__/index.test.js
+8
-0
package.json
examples/with-jest-react-testing-library/package.json
+3
-0
No files found.
examples/with-jest-react-testing-library/__tests__/__snapshots__/index.test.js.snap
0 → 100644
View file @
85fd832e
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`With React Testing Library Snapshot Should match Snapshot 1`] = `
<DocumentFragment>
<div>
<p>
Hello World!
</p>
</div>
</DocumentFragment>
`;
examples/with-jest-react-testing-library/__tests__/index.test.js
View file @
85fd832e
...
@@ -12,3 +12,11 @@ describe('With React Testing Library', () => {
...
@@ -12,3 +12,11 @@ describe('With React Testing Library', () => {
expect
(
getByText
(
'Hello World!'
)).
not
.
toBeNull
()
expect
(
getByText
(
'Hello World!'
)).
not
.
toBeNull
()
})
})
})
})
describe
(
'With React Testing Library Snapshot'
,
()
=>
{
it
(
'Should match Snapshot'
,
()
=>
{
const
{
asFragment
}
=
render
(
<
App
/>
)
expect
(
asFragment
()).
toMatchSnapshot
()
})
})
examples/with-jest-react-testing-library/package.json
View file @
85fd832e
...
@@ -7,6 +7,9 @@
...
@@ -7,6 +7,9 @@
"react-dom"
:
"latest"
"react-dom"
:
"latest"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"@babel/core"
:
"^7.1.2"
,
"babel-core"
:
"^7.0.0-bridge"
,
"babel-jest"
:
"^23.6.0"
,
"react-testing-library"
:
"^5.4.2"
,
"react-testing-library"
:
"^5.4.2"
,
"jest"
:
"^23.6.0"
"jest"
:
"^23.6.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