From: Jérôme Benoit Date: Fri, 7 Jun 2024 11:36:22 +0000 (+0200) Subject: test: add ConfigurationUtils test X-Git-Tag: v1.3.5~21 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=2a9305b5ace7b5a49b5862c4282c1a88e3087da5;p=e-mobility-charging-stations-simulator.git test: add ConfigurationUtils test Signed-off-by: Jérôme Benoit --- diff --git a/tests/utils/ConfigurationUtils.test.ts b/tests/utils/ConfigurationUtils.test.ts new file mode 100644 index 00000000..e8bcf8e2 --- /dev/null +++ b/tests/utils/ConfigurationUtils.test.ts @@ -0,0 +1,16 @@ +import { describe, it } from 'node:test' + +import { expect } from 'expect' + +import { FileType } from '../../src/types/index.js' +import { handleFileException } from '../../src/utils/ConfigurationUtils.js' + +await describe('ConfigurationUtils test suite', async () => { + await it('Verify handleFileException()', () => { + const error = new Error() + error.code = 'ENOENT' + expect(() => { + handleFileException('path/to/module.js', FileType.Authorization, error, 'log prefix') + }).toThrow(error) + }) +})