| 1 | import { describe, expect, it } from "bun:test"; |
| 2 | |
| 3 | import { apiErrorMessage } |
| 4 | |
| 5 | describe("apiErrorMessage", () |
| 6 | it("reads the filter's message, joins a validation pipe's list, and falls back otherwise", |
| 7 | expect(apiErrorMessage({ |
| 8 | "Repository not found", |
| 9 | ); |
| 10 | expect( |
| 11 | apiErrorMessage({ |
| 12 | message: ["target must be shorter than or equal to 250 characters"], |
| 13 | }), |
| 14 | ).toBe("target must be shorter than or equal to 250 characters" |
| 15 | expect(apiErrorMessage({ |
| 16 | expect(apiErrorMessage(undefined)) |
| 17 | }); |
| 18 | }); |