test: improve ErrorUtils coverage
[e-mobility-charging-stations-simulator.git] / tests / utils / ConfigurationUtils.test.ts
1 import { describe, it } from 'node:test'
2
3 import { expect } from 'expect'
4
5 import { FileType } from '../../src/types/index.js'
6 import { handleFileException } from '../../src/utils/ConfigurationUtils.js'
7
8 await describe('ConfigurationUtils test suite', async () => {
9 await it('Verify handleFileException()', () => {
10 const error = new Error()
11 error.code = 'ENOENT'
12 expect(() => {
13 handleFileException('path/to/module.js', FileType.Authorization, error, 'log prefix |')
14 }).toThrow(error)
15 })
16 })