-
Notifications
You must be signed in to change notification settings - Fork 343
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(deps): drop mz
dependency
#3215
Changes from 5 commits
abca429
4f98bc7
6d8dbb1
3506582
0d8bae3
866d2a6
19bc024
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { fs } from 'mz'; | ||
import fs from 'fs/promises'; | ||
|
||
import { isErrorWithCode } from '../errors.js'; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { fs } from 'mz'; | ||
import fs from 'fs/promises'; | ||
|
||
import { onlyErrorsWithCode } from '../errors.js'; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import path from 'path'; | ||
import nodeFs from 'fs'; | ||
import fs from 'fs/promises'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sometimes both APIs are used. For consistency, I let |
||
|
||
import { fs } from 'mz'; | ||
import { afterEach, beforeEach, describe, it } from 'mocha'; | ||
import { assert } from 'chai'; | ||
import * as sinon from 'sinon'; | ||
|
@@ -368,18 +369,18 @@ describe('run', () => { | |
describe('profile-create-new option', () => { | ||
beforeEach(() => { | ||
sinon.stub(fs, 'mkdir'); | ||
sinon.stub(fs, 'existsSync'); | ||
sinon.stub(nodeFs, 'existsSync'); | ||
}); | ||
|
||
afterEach(() => { | ||
fs.mkdir.restore(); | ||
fs.existsSync.restore(); | ||
nodeFs.existsSync.restore(); | ||
}); | ||
|
||
const fakeProfile = '/pretend/path/to/profile'; | ||
|
||
async function testCreateProfileIfMissing(expectProfileExists, runParams) { | ||
fs.existsSync.returns(expectProfileExists); | ||
nodeFs.existsSync.returns(expectProfileExists); | ||
const cmd = await prepareRun(); | ||
|
||
await cmd.run(runParams); | ||
|
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.
In some cases I used the single export instead. This pattern was also already used in parts of the repo. However this is not always possible due to stubbing.
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.
Makes sense (and thanks a lot for mentioning the motivations behind these choices explicitly in this comment, that really helped to speed up the review and sign off ❤️)