Skip to content

Commit

Permalink
chore: remove usage of unnecessary util.promisify
Browse files Browse the repository at this point in the history
This is safe to do now that we've dropped node 10 support.
  • Loading branch information
lukekarrys committed Nov 3, 2021
1 parent 8ffeb71 commit c37988f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
4 changes: 1 addition & 3 deletions lib/utils/reify-finish.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const reifyOutput = require('./reify-output.js')
const ini = require('ini')
const util = require('util')
const fs = require('fs')
const { writeFile } = fs.promises || { writeFile: util.promisify(fs.writeFile) }
const { writeFile } = require('fs').promises
const {resolve} = require('path')

const reifyFinish = async (npm, arb) => {
Expand Down
8 changes: 0 additions & 8 deletions test/lib/utils/reify-finish.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,3 @@ t.test('should write if everything above passes', async t => {
const data = fs.readFileSync(`${path}/npmrc`, 'utf8').replace(/\r\n/g, '\n')
t.matchSnapshot(data, 'written config')
})

t.test('works without fs.promises', async t => {
t.doesNotThrow(() => t.mock('../../../lib/utils/reify-finish.js', {
fs: { ...fs, promises: null },
'../../../lib/npm.js': npm,
'../../../lib/utils/reify-output.js': reifyOutput,
}))
})

0 comments on commit c37988f

Please sign in to comment.