Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
silkentrance committed Apr 8, 2020
1 parent 2c80c6d commit c7028f2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/assertions.js
Expand Up @@ -23,7 +23,7 @@ module.exports.assertMode = function assertMode(name, mode) {
// mode values do not work properly on Windows. Ignore “group” and
// “other” bits then. Ignore execute bit on that platform because it
// doesn’t exist—even for directories.
if (process.platform == 'win32') {
if (process.platform === 'win32') {
assert.equal(stat.mode & 0o600, mode & 0o600);
} else {
assert.equal(stat.mode & 0o777, mode);
Expand Down
2 changes: 2 additions & 0 deletions test/outband/unlink.js
Expand Up @@ -3,6 +3,8 @@ const fs = require('fs');
module.exports = function (result) {
const stat = fs.statSync(result.name);
if (stat.isFile()) {
// TODO must also close the file, otherwise the file will be closed during garbage collection, which we do not want
// TODO #241 get rid of the open file descriptor
fs.unlinkSync(result.name);
} else {
fs.rmdirSync(result.name);
Expand Down
3 changes: 1 addition & 2 deletions test/outband/unsafe.js
Expand Up @@ -15,12 +15,11 @@ module.exports = function (result) {
// symlink that should be removed but the contents should be preserved.
// Skip on Windows because symlinks require elevated privileges (instead just
// create the file)
if (process.platform == 'win32') {
if (process.platform === 'win32') {
fs.writeFileSync(symlinkTarget);
} else {
fs.symlinkSync(symlinkSource, symlinkTarget, 'dir');
}

this.out(result.name);
};

0 comments on commit c7028f2

Please sign in to comment.