-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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(gatsby): Convert cache.js to TypeScript #20626
Conversation
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.
I think the Cache should have a type parameter since all inputs/outputs are of the same type. If you type it on the methods then the same Cache instance could be called with different types and the types wouldn't mean much...
Am I wrong? Maybe it works a little different from Flow.
|
||
beforeEach(() => { | ||
manager.caching.mockReset() | ||
fs.ensureDirSync.mockReset() | ||
;(manager.caching as jest.Mock).mockReset() |
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.
Prettier insists
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.
that's normal :) because else it could be a return function of mockReset
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.
Awesome! 👏 👏 👏
Description
Trying again with #20622 to see if I can preserve history. This includes the changes to enable Jest to run on TypeScript files that were in #20457. It also has a couple of additions to tsconfig to reflect the fact we're running in Node not the browser
Documentation
n/a
Related Issues
#20457