testing-library / testing-library/testing-library-docs

example-intro page provides an example using old version of msw

Open
#1,365 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
479
Forks
740
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
The "full example" at https://testing-library.com/docs/react-testing-library/example-intro imports rest from msw, which is not exported by the latest version of msw (2.1.7).

To Reproduce

  1. Go to https://testing-library.com/docs/react-testing-library/example-intro
  2. Use the Full Example to set up a test in your own project
  3. Realize that you don't have msw installed
  4. npm i -D msw
  5. Get Module '"msw"' has no exported member 'rest'. error

Expected behavior
No errors on the import {rest} from msw line

Additional context
I'm guessing the documentation was written when rest was a thing, now http appears to have replaced it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the React Testing Library example-intro page and inspect the Full Example's MSW import. Compare the example with MSW 2.1.7, update the outdated import, and verify that the documented setup no longer reports the missing export error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.