Skip to content

Commit 46415a2

Browse files
committed
docs: add a recommendation block for msw
1 parent 51a31d3 commit 46415a2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/react-testing-library/example-intro.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ test('loads and displays greeting', async () => {
3939
})
4040
```
4141

42+
> We recommend using [Mock Service Worker](https://github.com/mswjs/msw) library
43+
> to declaratively mock API communication in your tests instead of stubbing
44+
> `window.fetch`, or relying on third-party adapters.
45+
4246
---
4347

4448
## Step-By-Step
@@ -50,7 +54,6 @@ test('loads and displays greeting', async () => {
5054
import React from 'react'
5155

5256
// import API mocking utilities from Mock Service Worker
53-
// (see https://github.com/mswjs/msw)
5457
import { rest } from 'msw'
5558
import { setupServer } from 'msw/node'
5659

0 commit comments

Comments
 (0)