Açıklama Yok

ConfigurationUtils.test.ts 793B

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