diff --git a/test/parallel/test-fs-options-immutable.js b/test/parallel/test-fs-options-immutable.js index b993d776e6e..77ce3ebf1de 100644 --- a/test/parallel/test-fs-options-immutable.js +++ b/test/parallel/test-fs-options-immutable.js @@ -6,19 +6,17 @@ const common = require('../common'); // // Refer: https://github.com/nodejs/node/issues/7655 -const assert = require('assert'); const fs = require('fs'); const path = require('path'); -const errHandler = (e) => assert.ifError(e); const options = Object.freeze({}); const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); -fs.readFile(__filename, options, common.mustCall(errHandler)); +fs.readFile(__filename, options, common.mustSucceed()); fs.readFileSync(__filename, options); -fs.readdir(__dirname, options, common.mustCall(errHandler)); +fs.readdir(__dirname, options, common.mustSucceed()); fs.readdirSync(__dirname, options); if (common.canCreateSymLink()) { @@ -28,20 +26,20 @@ if (common.canCreateSymLink()) { fs.writeFileSync(sourceFile, ''); fs.symlinkSync(sourceFile, linkFile); - fs.readlink(linkFile, options, common.mustCall(errHandler)); + fs.readlink(linkFile, options, common.mustSucceed()); fs.readlinkSync(linkFile, options); } { const fileName = path.resolve(tmpdir.path, 'writeFile'); fs.writeFileSync(fileName, 'ABCD', options); - fs.writeFile(fileName, 'ABCD', options, common.mustCall(errHandler)); + fs.writeFile(fileName, 'ABCD', options, common.mustSucceed()); } { const fileName = path.resolve(tmpdir.path, 'appendFile'); fs.appendFileSync(fileName, 'ABCD', options); - fs.appendFile(fileName, 'ABCD', options, common.mustCall(errHandler)); + fs.appendFile(fileName, 'ABCD', options, common.mustSucceed()); } if (!common.isIBMi) { // IBMi does not support fs.watch() @@ -56,13 +54,13 @@ if (!common.isIBMi) { // IBMi does not support fs.watch() { fs.realpathSync(__filename, options); - fs.realpath(__filename, options, common.mustCall(errHandler)); + fs.realpath(__filename, options, common.mustSucceed()); } { const tempFileName = path.resolve(tmpdir.path, 'mkdtemp-'); fs.mkdtempSync(tempFileName, options); - fs.mkdtemp(tempFileName, options, common.mustCall(errHandler)); + fs.mkdtemp(tempFileName, options, common.mustSucceed()); } {