UNPKG

2.64 kBJavaScriptView Raw
1"use strict";
2/**
3 * This file is part of the @egodigital/egoose distribution.
4 * Copyright (c) e.GO Digital GmbH, Aachen, Germany (https://www.e-go-digital.com/)
5 *
6 * @egodigital/egoose is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation, version 3.
9 *
10 * @egodigital/egoose is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18Object.defineProperty(exports, "__esModule", { value: true });
19const assert = require("assert");
20const mocha_1 = require("mocha");
21const fs_1 = require("../fs");
22mocha_1.describe('#isDir()', async function () {
23 mocha_1.describe('async', async function () {
24 mocha_1.it('script check', async function () {
25 const THAT_FILE = await fs_1.isDir(__filename);
26 const THAT_DIR = await fs_1.isDir(__dirname);
27 assert.equal(THAT_DIR, true);
28 assert.strictEqual(THAT_DIR, true);
29 assert.equal(THAT_FILE, false);
30 assert.strictEqual(THAT_FILE, false);
31 });
32 mocha_1.it('script check (LSTAT)', async function () {
33 const THAT_FILE = await fs_1.isDir(__filename, true);
34 const THAT_DIR = await fs_1.isDir(__dirname, true);
35 assert.equal(THAT_DIR, true);
36 assert.strictEqual(THAT_DIR, true);
37 assert.equal(THAT_FILE, false);
38 assert.strictEqual(THAT_FILE, false);
39 });
40 });
41 mocha_1.describe('sync', async function () {
42 mocha_1.it('script check', function () {
43 const THAT_FILE = fs_1.isDirSync(__filename);
44 const THAT_DIR = fs_1.isDirSync(__dirname);
45 assert.equal(THAT_DIR, true);
46 assert.strictEqual(THAT_DIR, true);
47 assert.equal(THAT_FILE, false);
48 assert.strictEqual(THAT_FILE, false);
49 });
50 mocha_1.it('script check (LSTAT)', function () {
51 const THAT_FILE = fs_1.isDirSync(__filename, true);
52 const THAT_DIR = fs_1.isDirSync(__dirname, true);
53 assert.equal(THAT_DIR, true);
54 assert.strictEqual(THAT_DIR, true);
55 assert.equal(THAT_FILE, false);
56 assert.strictEqual(THAT_FILE, false);
57 });
58 });
59});
60//# sourceMappingURL=isDir.js.map
\No newline at end of file