-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
chore: fix some type errors in tests #13360
Conversation
'beforeAll', | ||
'afterEach', | ||
'afterAll', | ||
] as Array<Circus.HookType>)('%s hooks error throwing', fn => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No magic with as const
? (By the way, I guess this could might be good candidate for satisfies
.)
] as Array<Circus.HookType>)('%s hooks error throwing', fn => { | |
] as const)('%s hooks error throwing', fn => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as const
doesn't really work - then it's always hard coded to the first value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably an issue with jest-each
's types, but I haven't dug into it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checked. Interesting... I will check what is going on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Types are buggy and test is broken too.
Here list
is [1, 2, 3]
. That’s why it looks like just first value is picked up. Add second arg and second value will be there. In reality there is no second arg ;D Ups.. I will fix. Good to catch it!
packages/jest-fake-timers/src/__tests__/legacyFakeTimers.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Tom Mrazauskas <[email protected]>
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
I was bored on my flight home, so went over a random assortment of tests and fixed some type errors.
Ignore whitespace for this one: https://github.com/facebook/jest/pull/13360/files?w=1
Test plan
Green CI