Skip to content

Commit

Permalink
test: replace function with arrow function
Browse files Browse the repository at this point in the history
PR-URL: #23474
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
  • Loading branch information
yitongding authored and rvagg committed Nov 28, 2018
1 parent f91dd7b commit 7a5c900
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-fs-write.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ common.allowGlobals(externalizeString, isOneByteString, x);
}
/* eslint-enable no-undef */

fs.open(fn, 'w', 0o644, common.mustCall(function(err, fd) {
fs.open(fn, 'w', 0o644, common.mustCall((err, fd) => {
assert.ifError(err);

const done = common.mustCall(function(err, written) {
const done = common.mustCall((err, written) => {
assert.ifError(err);
assert.strictEqual(written, Buffer.byteLength(expected));
fs.closeSync(fd);
Expand All @@ -91,7 +91,7 @@ fs.open(fn, 'w', 0o644, common.mustCall(function(err, fd) {
assert.strictEqual(found, expected);
});

const written = common.mustCall(function(err, written) {
const written = common.mustCall((err, written) => {
assert.ifError(err);
assert.strictEqual(written, 0);
fs.write(fd, expected, 0, 'utf8', done);
Expand All @@ -113,7 +113,7 @@ fs.open(fn2, args, 0o644, common.mustCall((err, fd) => {
assert.strictEqual(found, expected);
});

const written = common.mustCall(function(err, written) {
const written = common.mustCall((err, written) => {
assert.ifError(err);
assert.strictEqual(written, 0);
fs.write(fd, expected, 0, 'utf8', done);
Expand All @@ -122,10 +122,10 @@ fs.open(fn2, args, 0o644, common.mustCall((err, fd) => {
fs.write(fd, '', 0, 'utf8', written);
}));

fs.open(fn3, 'w', 0o644, common.mustCall(function(err, fd) {
fs.open(fn3, 'w', 0o644, common.mustCall((err, fd) => {
assert.ifError(err);

const done = common.mustCall(function(err, written) {
const done = common.mustCall((err, written) => {
assert.ifError(err);
assert.strictEqual(written, Buffer.byteLength(expected));
fs.closeSync(fd);
Expand Down

0 comments on commit 7a5c900

Please sign in to comment.