test: remove unlink function which is needless
PR-URL: https://github.com/nodejs/node/pull/17119 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This commit is contained in:
parent
fdbee334cd
commit
b28a28a55a
@ -24,13 +24,6 @@ const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const fs = require('fs');
|
||||
|
||||
function unlink(pathname) {
|
||||
try {
|
||||
fs.rmdirSync(pathname);
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
common.refreshTmpDir();
|
||||
|
||||
{
|
||||
@ -40,10 +33,6 @@ common.refreshTmpDir();
|
||||
assert.strictEqual(err, null);
|
||||
assert.strictEqual(common.fileExists(pathname), true);
|
||||
}));
|
||||
|
||||
process.on('exit', function() {
|
||||
unlink(pathname);
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
@ -53,21 +42,14 @@ common.refreshTmpDir();
|
||||
assert.strictEqual(err, null);
|
||||
assert.strictEqual(common.fileExists(pathname), true);
|
||||
}));
|
||||
|
||||
process.on('exit', function() {
|
||||
unlink(pathname);
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
const pathname = `${common.tmpDir}/test3`;
|
||||
|
||||
unlink(pathname);
|
||||
fs.mkdirSync(pathname);
|
||||
|
||||
const exists = common.fileExists(pathname);
|
||||
unlink(pathname);
|
||||
|
||||
assert.strictEqual(exists, true);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user