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:
buji authored and Gibson Fahnestock committed 2017-12-20 01:59:10 +00:00
1 parent 179a4f4fa4
commit 7900f8ae63
1 file changed
-18
-18
View File
@@ -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);
}