Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: update type tests #2093

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 3 commits into from
Apr 19, 2025
Merged

chore: update type tests #2093

merged 3 commits into from
Apr 19, 2025

Conversation

mrazauskas
Copy link
Contributor

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().


I think that .toBe<number>() looks more constant. Makes it is easier to move from .toBe<number>() to .toBe<Promise<number>>(), if the behaviour is changing. It was not clear why using .toBeNumber() is anyhow better.

Comment on lines 36 to 39
// eslint-disable-next-line @typescript-eslint/no-explicit-any
/* eslint-disable @typescript-eslint/no-explicit-any */
const create = [(data: any) => data, fromJS][1];

expect(create({ a: 'A' })).type.toBeAny();
expect(create({ a: 'A' })).type.toBe<any>();
Copy link
Contributor Author

@mrazauskas mrazauskas Apr 10, 2025

Choose a reason for hiding this comment

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

Also lint rules apply for .toBe<any>(). That looks like a one more win, actually.

@jdeniau jdeniau merged commit d1136cd into immutable-js:main Apr 19, 2025
5 checks passed
@jdeniau
Copy link
Member

jdeniau commented Apr 19, 2025

Thanks @mrazauskas

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