Skip to content

Commit c7028f2

Browse files
committed
cleanup code
1 parent 2c80c6d commit c7028f2

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

test/assertions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports.assertMode = function assertMode(name, mode) {
2323
// mode values do not work properly on Windows. Ignore “group” and
2424
// “other” bits then. Ignore execute bit on that platform because it
2525
// doesn’t exist—even for directories.
26-
if (process.platform == 'win32') {
26+
if (process.platform === 'win32') {
2727
assert.equal(stat.mode & 0o600, mode & 0o600);
2828
} else {
2929
assert.equal(stat.mode & 0o777, mode);

test/outband/unlink.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ const fs = require('fs');
33
module.exports = function (result) {
44
const stat = fs.statSync(result.name);
55
if (stat.isFile()) {
6+
// TODO must also close the file, otherwise the file will be closed during garbage collection, which we do not want
7+
// TODO #241 get rid of the open file descriptor
68
fs.unlinkSync(result.name);
79
} else {
810
fs.rmdirSync(result.name);

test/outband/unsafe.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ module.exports = function (result) {
1515
// symlink that should be removed but the contents should be preserved.
1616
// Skip on Windows because symlinks require elevated privileges (instead just
1717
// create the file)
18-
if (process.platform == 'win32') {
18+
if (process.platform === 'win32') {
1919
fs.writeFileSync(symlinkTarget);
2020
} else {
2121
fs.symlinkSync(symlinkSource, symlinkTarget, 'dir');
2222
}
2323

2424
this.out(result.name);
2525
};
26-

0 commit comments

Comments
 (0)