Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: replace function with arrow function
  • Loading branch information
yitongding committed Oct 12, 2018
commit 31d05ab7cc8700f366e8c5cf29ff2d8084ac4114
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