fix: accept 422 for BMP tests when ImageMagick unavailable

BMP decoding without ImageMagick returns 422 (not 400). Allow
200/400/422 for BMP input tests matching the existing format-matrix
pattern for exotic formats.
This commit is contained in:
SnapOtter
2026-05-09 10:29:17 +08:00
parent 5962590bd8
commit 346abd6168
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -949,7 +949,7 @@ describe("Border", () => {
body,
});
expect([200, 400]).toContain(res.statusCode);
expect([200, 400, 422]).toContain(res.statusCode);
if (res.statusCode === 200) {
const result = JSON.parse(res.body);
expect(result.processedSize).toBeGreaterThan(0);
+1 -1
View File
@@ -498,7 +498,7 @@ describe("BMP input", () => {
"test.bmp",
"image/bmp",
);
expect([200, 400]).toContain(res.statusCode);
expect([200, 400, 422]).toContain(res.statusCode);
if (res.statusCode === 200) {
const result = JSON.parse(res.body);
expect(result.downloadUrl).toBeDefined();
+1 -1
View File
@@ -522,7 +522,7 @@ describe("BMP input", () => {
it("processes BMP image with adaptive sharpening", async () => {
const BMP = readFileSync(join(FIXTURES, "formats", "sample.bmp"));
const res = await postTool({ method: "adaptive", sigma: 2.0 }, BMP, "test.bmp", "image/bmp");
expect([200, 400]).toContain(res.statusCode);
expect([200, 400, 422]).toContain(res.statusCode);
if (res.statusCode === 200) {
const result = JSON.parse(res.body);
expect(result.downloadUrl).toBeDefined();