import { describe, expect, it } from '@jest/globals'; import { wrapNativePostgresCallAsync } from '../wrapNativePostgresCallAsync.ts'; describe(wrapNativePostgresCallAsync, () => { it('rethrows literals', async () => { const throwingFn = async (): Promise => { // eslint-disable-next-line no-throw-literal,@typescript-eslint/only-throw-error throw 'hello'; }; let capturedThrownThing: any; try { await wrapNativePostgresCallAsync(throwingFn); } catch (e) { capturedThrownThing = e; } expect(capturedThrownThing).not.toBeInstanceOf(Error); expect(capturedThrownThing).toEqual('hello'); }); });