Skip to content

Commit 32ccd3c

Browse files
lukekarryswraithgar
authored andcommitted
chore: remove usage of unnecessary util.promisify
This is safe to do now that we've dropped node 10 support. PR-URL: #3988 Credit: @lukekarrys Close: #3988 Reviewed-by: @wraithgar
1 parent c640957 commit 32ccd3c

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

lib/utils/reify-finish.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
const reifyOutput = require('./reify-output.js')
22
const ini = require('ini')
3-
const util = require('util')
4-
const fs = require('fs')
5-
const { writeFile } = fs.promises || { writeFile: util.promisify(fs.writeFile) }
3+
const { writeFile } = require('fs').promises
64
const {resolve} = require('path')
75

86
const reifyFinish = async (npm, arb) => {

test/lib/utils/reify-finish.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,3 @@ t.test('should write if everything above passes', async t => {
7676
const data = fs.readFileSync(`${path}/npmrc`, 'utf8').replace(/\r\n/g, '\n')
7777
t.matchSnapshot(data, 'written config')
7878
})
79-
80-
t.test('works without fs.promises', async t => {
81-
t.doesNotThrow(() => t.mock('../../../lib/utils/reify-finish.js', {
82-
fs: { ...fs, promises: null },
83-
'../../../lib/npm.js': npm,
84-
'../../../lib/utils/reify-output.js': reifyOutput,
85-
}))
86-
})

0 commit comments

Comments
 (0)