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/providers/filters/error.spec.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const assert = require("assert");
const settings_1 = require("../../settings");
const tests = require("../../tests");
const error_1 = require("./error");
function getErrorFilterInstance(options) {
    const settings = new settings_1.default(options);
    return new error_1.default(settings);
}
function getFilter(options) {
    return getErrorFilterInstance(options).getFilter();
}
describe('Providers → Filters → Error', () => {
    describe('Constructor', () => {
        it('should create instance of class', () => {
            const filter = getErrorFilterInstance();
            assert.ok(filter instanceof error_1.default);
        });
    });
    describe('.getFilter', () => {
        it('should return true for ENOENT error', () => {
            const filter = getFilter();
            const actual = filter(tests.errno.getEnoent());
            assert.ok(actual);
        });
        it('should return true for EPERM error when the `suppressErrors` options is enabled', () => {
            const filter = getFilter({ suppressErrors: true });
            const actual = filter(tests.errno.getEperm());
            assert.ok(actual);
        });
        it('should return false for EPERM error', () => {
            const filter = getFilter();
            const actual = filter(tests.errno.getEperm());
            assert.ok(!actual);
        });
    });
});