Skip to content

Commit 3724ae3

Browse files
authored
test: fix bug in integration test helper (#6531)
1 parent bc2bcd4 commit 3724ae3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

integration-tests/helpers/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const childProcess = require('child_process')
55
const { fork, spawn } = childProcess
66
const exec = promisify(childProcess.exec)
77
const http = require('http')
8-
const { existsSync, readFileSync, unlinkSync } = require('fs')
8+
const { existsSync, readFileSync, unlinkSync, writeFileSync } = require('fs')
99
const fs = require('fs/promises')
1010
const { builtinModules } = require('module')
1111
const os = require('os')
@@ -292,7 +292,7 @@ async function createSandbox (dependencies = [], isGitRepo = false,
292292
* @returns {object} A map from variant names to resulting filenames
293293
*/
294294
function varySandbox (sandbox, filename, variants, bindingName, namedVariant, packageName) {
295-
const origFileData = fs.readFileSync(path.join(sandbox.folder, filename), 'utf8')
295+
const origFileData = readFileSync(path.join(sandbox.folder, filename), 'utf8')
296296
const [prefix, suffix] = filename.split('.')
297297
const variantFilenames = {}
298298
packageName = packageName || bindingName
@@ -313,7 +313,7 @@ function varySandbox (sandbox, filename, variants, bindingName, namedVariant, pa
313313
if (variant !== 'default') {
314314
newFileData = origFileData.replace(variants.default, `${variants[variant]}`)
315315
}
316-
fs.writeFileSync(path.join(sandbox.folder, variantFilename), newFileData)
316+
writeFileSync(path.join(sandbox.folder, variantFilename), newFileData)
317317
}
318318
return variantFilenames
319319
}

0 commit comments

Comments
 (0)