Skip to content
Closed
Show file tree
Hide file tree
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
Next Next commit
test: use shorthand properties in fs tests
  • Loading branch information
tniessen committed Jan 11, 2018
commit 1978be73aac499f4d6961c229431620684a0f5d6
8 changes: 4 additions & 4 deletions test/parallel/test-fs-realpath-buffer-encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ for (encoding in expected) {
const expected_value = expected[encoding];
let result;

result = fs.realpathSync(string_dir, { encoding: encoding });
result = fs.realpathSync(string_dir, { encoding });
assert.strictEqual(result, expected_value);

result = fs.realpathSync(string_dir, encoding);
assert.strictEqual(result, expected_value);

result = fs.realpathSync(buffer_dir, { encoding: encoding });
result = fs.realpathSync(buffer_dir, { encoding });
assert.strictEqual(result, expected_value);

result = fs.realpathSync(buffer_dir, encoding);
Expand All @@ -53,7 +53,7 @@ for (encoding in expected) {

fs.realpath(
string_dir,
{ encoding: encoding },
{ encoding },
common.mustCall((err, res) => {
assert.ifError(err);
assert.strictEqual(res, expected_value);
Expand All @@ -65,7 +65,7 @@ for (encoding in expected) {
}));
fs.realpath(
buffer_dir,
{ encoding: encoding },
{ encoding },
common.mustCall((err, res) => {
assert.ifError(err);
assert.strictEqual(res, expected_value);
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-fs-write-file-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ common.refreshTmpDir();
// Test writeFileSync
const file1 = path.join(common.tmpDir, 'testWriteFileSync.txt');

fs.writeFileSync(file1, '123', { mode: mode });
fs.writeFileSync(file1, '123', { mode });

content = fs.readFileSync(file1, { encoding: 'utf8' });
assert.strictEqual(content, '123');
Expand All @@ -61,7 +61,7 @@ assert.strictEqual(fs.statSync(file1).mode & 0o777, mode);
// Test appendFileSync
const file2 = path.join(common.tmpDir, 'testAppendFileSync.txt');

fs.appendFileSync(file2, 'abc', { mode: mode });
fs.appendFileSync(file2, 'abc', { mode });

content = fs.readFileSync(file2, { encoding: 'utf8' });
assert.strictEqual(content, 'abc');
Expand Down