testing-library-docs icon indicating copy to clipboard operation
testing-library-docs copied to clipboard

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

Open skondrashov opened this issue 2 years ago • 2 comments

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.

skondrashov avatar Feb 08 '24 16:02 skondrashov

We're in the process of updating the example at https://github.com/testing-library/testing-library-docs/pull/1327

timdeschryver avatar Feb 08 '24 18:02 timdeschryver

Wonderful! Looking forward to it :)

skondrashov avatar Feb 08 '24 19:02 skondrashov