@@ -84,7 +84,7 @@ As you write your tests, keep in mind:
84
84
<summary >If I can't use shallow rendering, how do I mock out components in tests?</summary >
85
85
86
86
In general, you should avoid mocking out components (see
87
- [ the Guiding Principles section] ( ./guiding-principles ) ). However if you need to,
87
+ [ the Guiding Principles section] ( .. /guiding-principles ) ). However if you need to,
88
88
then it's pretty trivial using
89
89
[ Jest's mocking feature] ( https://facebook.github.io/jest/docs/en/manual-mocks.html ) .
90
90
One case that I've found mocking to be especially useful is for animation
@@ -116,14 +116,14 @@ test('you can mock things with jest.mock', () => {
116
116
Note that because they're Jest mock functions (` jest.fn() ` ), you could also make
117
117
assertions on those as well if you wanted.
118
118
119
- [ Open full test] ( ./example-react-transition-group ) for the full example.
119
+ [ Open full test] ( .. /example-react-transition-group ) for the full example.
120
120
121
121
This looks like more work that shallow rendering (and it is), but it gives you
122
122
more confidence so long as your mock resembles the thing you're mocking closely
123
123
enough.
124
124
125
125
If you want to make things more like shallow rendering, then you could do
126
- something more [ like this] ([ Open full test] ( ./example-react-transition-group ) ).
126
+ something more [ like this] ([ Open full test] ( .. /example-react-transition-group ) ).
127
127
128
128
Learn more about how Jest mocks work from my blog post:
129
129
[ "But really, what is a JavaScript mock?"] ( https://blog.kentcdodds.com/but-really-what-is-a-javascript-mock-10d060966f7d )
0 commit comments