Skip to content

chore: update type tests #15569

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 1 commit into from
Apr 18, 2025
Merged

chore: update type tests #15569

merged 1 commit into from
Apr 18, 2025

Conversation

mrazauskas
Copy link
Contributor

@mrazauskas mrazauskas commented Apr 10, 2025

Summary

Primitive type matchers like .toBeString() or .toBeBoolean() will be removed in the next major TSTyche release. Reference: https://tstyche.org/releases/tstyche-4#matchers

This PR is replacing them with .toBe().


The primitive type were adding bloat to the code base and did not look needed anyhow. For example, if some behaviour is changing it is easier to move from .toBe<string>() to .toBe<Promise<string>>(). It was not clear why using .toBeString() is anyhow better.

Test plan

Green CI.

Copy link

netlify bot commented Apr 10, 2025

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit dbfbfb8
🔍 Latest deploy log https://app.netlify.com/sites/jestjs/deploys/67f7c9aea86b360008b665c7
😎 Deploy Preview https://deploy-preview-15569--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines +357 to 360
expect(mockFn.withImplementation(mockFnImpl, () => {})).type.toBe<void>();
expect(mockFn.withImplementation(mockFnImpl, async () => {})).type.toBe<
Promise<void>
>();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For instance, here and in other similar places the code is easer to read when .toBe() used. At least I think so.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

Cool, thanks!

@SimenB SimenB merged commit 2d9dedd into jestjs:main Apr 18, 2025
86 checks passed
@mrazauskas mrazauskas deleted the update-type-tests branch April 18, 2025 11:07
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