no-negative-only-http-status-assertion
Assert the intended HTTP status instead of only excluding a server error.
Why
A response can avoid status 500 while still fail with an unrelated 400, 401 or 404, so the test can pass without exercising the intended behavior.
Fix
Assert the expected response status or a deliberately bounded success/error contract. Preserve negative assertions that supplement an exact assertion for the same response.
Examples
import { test, expect } from "vitest";test("reads", async () => { const response = await fetch("/versions"); expect(response.status).not.toBe(500);});import { test, expect } from "vitest";test("reads", async () => { const response = await fetch("/versions"); expect(response.status).toBe(200);});