Skip to content

chore: convert Jest examples to TypeScript #32705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 22, 2021

Conversation

balazsorban44
Copy link
Member

@balazsorban44 balazsorban44 commented Dec 21, 2021

Fixes #32670, Fixes #28915, Fixes #29893

Bug

  • Related issues linked using fixes #number
  • Integration tests added
  • Errors have helpful link attached, see contributing.md

Feature

  • Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
  • Related issues linked using fixes #number
  • Integration tests added
  • Documentation added
  • Telemetry added. In case of a feature if it's used or not.
  • Errors have helpful link attached, see contributing.md

Documentation / Examples

  • Make sure the linting passes by running yarn lint

@balazsorban44
Copy link
Member Author

balazsorban44 commented Dec 21, 2021

I also decided to apply best practices from @testing-library/react. Using render.container (which gives pure HTML snapshot, instead of a React one) instead of react-test-renderer (dev dependency package/type could have been removed)

JSDom is included in the jest config, instead of as a comment on the top of the test file. (I believe it's a much more common strategy than the comment version.)

I also upgraded all the dependencies.

References:

@balazsorban44
Copy link
Member Author

balazsorban44 commented Dec 21, 2021

I see @testing-library/user-event as a dependency, but there is no shown example of it being used. I think we should either add a test that uses it, or remove it as a dependency.

It's also not being discussed or mentioned in the docs page

@balazsorban44
Copy link
Member Author

balazsorban44 commented Dec 21, 2021

What's the purpose of the __mock__ folder in the with-jest-babel example? Removing it seems to make no difference. 🤔

Figured, it's part of the docs. Added link to that from those files

@balazsorban44 balazsorban44 merged commit 48dba64 into canary Dec 22, 2021
@balazsorban44 balazsorban44 deleted the examples/jest-examples-to-ts branch December 22, 2021 00:12
kodiakhq bot pushed a commit that referenced this pull request Jan 4, 2022
The `with-jest` example has been converted to TypeScript (#32705) , but `typescript` and `@types/react` were missing from `devDependencies`

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue was opened via the examples template.
Projects
None yet
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy