1 import { describe
, it
} from
'node:test'
3 import { expect
} from
'expect'
5 import { FileType
} from
'../../src/types/index.js'
6 import { handleFileException
, setDefaultErrorParams
} from
'../../src/utils/ErrorUtils.js'
8 await describe('ErrorUtils test suite', async () => {
9 await it('Verify handleFileException()', () => {
10 const error
= new Error()
13 handleFileException('path/to/module.js', FileType
.Authorization
, error
, 'log prefix', {})
16 handleFileException('path/to/module.js', FileType
.Authorization
, error
, 'log prefix', {
22 await it('Verify setDefaultErrorParams()', () => {
23 expect(setDefaultErrorParams({})).toStrictEqual({ throwError
: true, consoleOut
: false })
24 expect(setDefaultErrorParams({ throwError
: false })).toStrictEqual({
28 expect(setDefaultErrorParams({ throwError
: false, consoleOut
: true })).toStrictEqual({
32 expect(setDefaultErrorParams({ throwError
: true, consoleOut
: true })).toStrictEqual({
36 expect(setDefaultErrorParams({}, { throwError
: false, consoleOut
: false })).toStrictEqual({