Commit | Line | Data |
---|---|---|
329f14c0 | 1 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ |
2a9305b5 JB |
2 | import { describe, it } from 'node:test' |
3 | ||
4 | import { expect } from 'expect' | |
5 | ||
6 | import { FileType } from '../../src/types/index.js' | |
7 | import { handleFileException } from '../../src/utils/ConfigurationUtils.js' | |
8 | ||
9 | await describe('ConfigurationUtils test suite', async () => { | |
329f14c0 JB |
10 | await it('Verify handleFileException()', t => { |
11 | t.mock.method(console, 'error') | |
2a9305b5 JB |
12 | const error = new Error() |
13 | error.code = 'ENOENT' | |
14 | expect(() => { | |
0acbf5e6 | 15 | handleFileException('path/to/module.js', FileType.Authorization, error, 'log prefix |') |
2a9305b5 | 16 | }).toThrow(error) |
329f14c0 | 17 | expect(console.error.mock.calls.length).toBe(1) |
2a9305b5 JB |
18 | }) |
19 | }) |