Skip to content
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

test: add jest-dom matchers and eslint plugin #997

Merged

Conversation

kretajak
Copy link
Contributor

@kretajak kretajak commented Nov 11, 2024

Summary

Testing Library provides nice set of custom matchers that are more declarative and easier to understand. Along with @testing-library/jest-dom there is an accompanying eslint-plugin-jest-dom which enforce using these selectors.

Check List

  • pnpm run prettier for formatting code and docs

Copy link

vercel bot commented Nov 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
valtio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 12, 2024 9:00pm

Copy link

codesandbox-ci bot commented Nov 11, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link

pkg-pr-new bot commented Nov 11, 2024

Open in Stackblitz

More templates

pnpm add https://pkg.pr.new/valtio@997

commit: 8cc6364

@kretajak kretajak force-pushed the use-jest-dom-matchers-and-eslint-plugin-jest-dom branch from d016dd4 to 2e0e4e9 Compare November 11, 2024 21:40
@kretajak kretajak force-pushed the use-jest-dom-matchers-and-eslint-plugin-jest-dom branch from 2e0e4e9 to c3d6ecd Compare November 11, 2024 21:46
@kretajak kretajak force-pushed the use-jest-dom-matchers-and-eslint-plugin-jest-dom branch from c3d6ecd to 6483f5d Compare November 11, 2024 22:11
@@ -2,7 +2,6 @@
"compilerOptions": {
"target": "esnext",
"strict": true,
"lib": ["es2023"],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line seems to be problematic with my changes and old TS versions. Zustand supports the same range of TypeScript versions but lacks this line. Maybe it can be safely removed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's added in #930. I think it's related to } catch { change.
If omitting this line goes well, I think it's fine to remove.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like using "lib": ["dom"] satisfies all TS versions.

@kretajak kretajak force-pushed the use-jest-dom-matchers-and-eslint-plugin-jest-dom branch from e8a3d02 to 8cc6364 Compare November 12, 2024 20:59
Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dai-shi dai-shi merged commit f3cbd01 into pmndrs:main Nov 13, 2024
28 checks passed
@kretajak kretajak deleted the use-jest-dom-matchers-and-eslint-plugin-jest-dom branch November 13, 2024 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants