HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/nodejs/fast-glob/out/settings.spec.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const assert = require("assert");
const os = require("os");
const settings_1 = require("./settings");
describe('Settings', () => {
    it('should return instance with default values', () => {
        const settings = new settings_1.default();
        assert.deepStrictEqual(settings.fs, settings_1.DEFAULT_FILE_SYSTEM_ADAPTER);
        assert.deepStrictEqual(settings.ignore, []);
        assert.ok(!settings.absolute);
        assert.ok(!settings.baseNameMatch);
        assert.ok(!settings.dot);
        assert.ok(!settings.markDirectories);
        assert.ok(!settings.objectMode);
        assert.ok(!settings.onlyDirectories);
        assert.ok(!settings.stats);
        assert.ok(!settings.suppressErrors);
        assert.ok(!settings.throwErrorOnBrokenSymbolicLink);
        assert.ok(settings.braceExpansion);
        assert.ok(settings.caseSensitiveMatch);
        assert.ok(settings.deep);
        assert.ok(settings.extglob);
        assert.ok(settings.followSymbolicLinks);
        assert.ok(settings.globstar);
        assert.ok(settings.onlyFiles);
        assert.ok(settings.unique);
        assert.strictEqual(settings.concurrency, os.cpus().length);
        assert.strictEqual(settings.cwd, process.cwd());
    });
    it('should return instance with custom values', () => {
        const settings = new settings_1.default({
            onlyFiles: false
        });
        assert.ok(!settings.onlyFiles);
    });
    it('should set the "onlyFiles" option when the "onlyDirectories" is enabled', () => {
        const settings = new settings_1.default({
            onlyDirectories: true
        });
        assert.ok(!settings.onlyFiles);
        assert.ok(settings.onlyDirectories);
    });
    it('should set the "objectMode" option when the "stats" is enabled', () => {
        const settings = new settings_1.default({
            stats: true
        });
        assert.ok(settings.objectMode);
        assert.ok(settings.stats);
    });
    it('should return the `fs` option with custom method', () => {
        const customReaddirSync = () => [];
        const settings = new settings_1.default({
            fs: { readdirSync: customReaddirSync }
        });
        assert.strictEqual(settings.fs.readdirSync, customReaddirSync);
    });
});