import { describe, expect, it } from 'vitest' import { esFormatError } from '../../../src/esError.js' describe('esFormatError', () => { it('prefixes an Error message', () => { expect(esFormatError({}, new Error('boom'))).toBe('[elasticsearch] boom') }) it('stringifies a non-Error value', () => { expect(esFormatError(undefined, 'plain')).toBe('[elasticsearch] plain') }) })