Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-go / lib / utils / fs.test.js
1 "use strict";
2 Object.defineProperty(exports, "__esModule", { value: true });
3 const tslib_1 = require("tslib");
4 const tmp_1 = tslib_1.__importDefault(require("tmp"));
5 const assert_1 = tslib_1.__importDefault(require("assert"));
6 const path_1 = tslib_1.__importDefault(require("path"));
7 const fs_1 = tslib_1.__importDefault(require("fs"));
8 const fs_2 = require("./fs");
9 describe('createDir()', () => {
10     let tmpDir;
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         fs_2.createDir(dirPath);
17         assert_1.default.ok(fs_1.default.existsSync(dirPath));
18     });
19     it('should create nested directories', () => {
20         const dirPath = joinPath('test', 'foo', 'bar');
21         fs_2.createDir(dirPath);
22         assert_1.default.ok(fs_1.default.existsSync(dirPath));
23     });
24     it('should not fail if directory exists', () => {
25         fs_2.createDir(tmpDir.name);
26         assert_1.default.ok(fs_1.default.existsSync(tmpDir.name));
27     });
28 });
29 //# sourceMappingURL=fs.test.js.map