-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Use real filesystem for unit testing #12172
Conversation
|
I need to fix the test fail, but thanks for the very quick review 😅 |
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.
Happy to merge!
Thanks for the reviews. I had trouble making |
Changes
Use the real filesystem for unit testing instead of mocking fs with
memfs
. This unblocks #12165. Benefits:fs
param.The PR uses
fs-fixture
(with a patch that I'll comment below) that allows us to create files and directories as fixtures to test on. It's merging tomain
instead ofnext
so that if anyone adds a new unit test in the future inmain
, they can use this pattern. Otherwise we have to manually migrate whenever merging main to next.This means after the PR is merged (I hope!), we can start removing our
fs
abstraction that was introduced only for tests, which should simply things more.Testing
Existing test should pass, especially unit tests
Docs
n/a