"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); }); }); });