From 2a9305b5ace7b5a49b5862c4282c1a88e3087da5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 7 Jun 2024 13:36:22 +0200 Subject: [PATCH] test: add ConfigurationUtils test MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- tests/utils/ConfigurationUtils.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/utils/ConfigurationUtils.test.ts 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) + }) +}) -- 2.34.1