-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
fix: Handle the case when staged-git-files errors properly #267
Conversation
Codecov Report
@@ Coverage Diff @@
## master #267 +/- ##
==========================================
+ Coverage 89.5% 90.12% +0.61%
==========================================
Files 10 10
Lines 162 162
Branches 23 23
==========================================
+ Hits 145 146 +1
+ Misses 16 15 -1
Partials 1 1
Continue to review full report at Codecov.
|
Having to mock it('should reject if staged-git-files returns an error', () => {
expect.assertions(1)
return runAll(packageJson, getConfig({ gitDir: os.tmpdir() })).catch(err => {
expect(err.message).toMatch(/fatal: Not a git repository/)
})
}) Do you know if there is a reliable way to get a temporary directory? I am using |
I like your suggestion although I think we still will need to test for different scenarios and it is easier to do with the mock. Why do you think it's problematic? BTW what about https://github.com/sindresorhus/os-tmpdir? |
Take
This is deprecated, and a ponyfill for |
Can you be more specific?
Since this is a bug fix for a blocker, I wouldn't spend much time here to make it right. We can always refactor later. |
We have 3 files for testing
If |
Since the implementation was already merged in #255, this PR only adds a test. It will trigger semantic-release to actually release the new version.
Closes #264