mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
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>
38 lines
864 B
JavaScript
38 lines
864 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const fs = require('fs');
|
|
|
|
common.refreshTmpDir();
|
|
|
|
{
|
|
const pathname = `${common.tmpDir}/test1`;
|
|
|
|
fs.mkdir(pathname, common.mustCall(function(err) {
|
|
assert.strictEqual(err, null);
|
|
assert.strictEqual(common.fileExists(pathname), true);
|
|
}));
|
|
}
|
|
|
|
{
|
|
const pathname = `${common.tmpDir}/test2`;
|
|
|
|
fs.mkdir(pathname, 0o777, common.mustCall(function(err) {
|
|
assert.strictEqual(err, null);
|
|
assert.strictEqual(common.fileExists(pathname), true);
|
|
}));
|
|
}
|
|
|
|
{
|
|
const pathname = `${common.tmpDir}/test3`;
|
|
|
|
fs.mkdirSync(pathname);
|
|
|
|
const exists = common.fileExists(pathname);
|
|
assert.strictEqual(exists, true);
|
|
}
|
|
|
|
// Keep the event loop alive so the async mkdir() requests
|
|
// have a chance to run (since they don't ref the event loop).
|
|
process.nextTick(() => {});
|