2 Object.defineProperty(exports, "__esModule", { value: true });
3 const tslib_1 = require("tslib");
4 const tmp_1 = (0, tslib_1.__importDefault)(require("tmp"));
5 const assert_1 = (0, tslib_1.__importDefault)(require("assert"));
6 const path_1 = (0, tslib_1.__importDefault)(require("path"));
7 const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
8 const fs_2 = require("./fs");
9 describe('createDir()', () => {
11 const joinPath = (...parts) => path_1.default.join(tmpDir.name, ...parts);
12 beforeEach(() => tmpDir = tmp_1.default.dirSync({ unsafeCleanup: true }));
13 afterEach(() => tmpDir.removeCallback());
14 it('should create a directory', () => {
15 const dirPath = joinPath('test');
16 (0, fs_2.createDir)(dirPath);
17 assert_1.default.ok(fs_1.default.existsSync(dirPath));
19 it('should create nested directories', () => {
20 const dirPath = joinPath('test', 'foo', 'bar');
21 (0, fs_2.createDir)(dirPath);
22 assert_1.default.ok(fs_1.default.existsSync(dirPath));
24 it('should not fail if directory exists', () => {
25 (0, fs_2.createDir)(tmpDir.name);
26 assert_1.default.ok(fs_1.default.existsSync(tmpDir.name));
29 //# sourceMappingURL=fs.test.js.map