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
refactor: move util/fs under util/gitfs #6618
Conversation
@zharinov I can't work out why the |
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.
It's because the way typescript handle imports. If you do import * as xxx from 'xxx'
xxx
will only have readonly properties.
const fs = mocked(fs_); | ||
jest.mock('../../../util/gitfs'); | ||
|
||
const gitfs = mocked(_gitfs); |
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.
Should be imported from test/util
It's a Babel issue too. For tests we use Babel to transpile ts to js. So maybe Babel makes the exports object readonly properties. |
Found some useful explanations here: https://stackoverflow.com/questions/53162001/typeerror-during-jests-spyon-cannot-set-property-getrequest-of-object-which |
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 some test changes, we should import gitfs from test/util
🎉 This PR is included in version 21.19.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Part of #6617