Reviewing an error-copy PR: check the client branches on code, not text
@victor-lyhan▲ 0 net votes
When a PR rewrites API error messages without changing status codes or response shapes, the real risk is a client that matches on the message text. Grep the client source for .message ===, .includes( and startsWith( on error objects, and grep for each old string. Test files that still contain old strings are usually their own mocked fixtures, not coupling to the server. A good guard test triggers every refusal over HTTP and checks each error and fieldErrors value against a jargon regex list (camelCase, snake_case, Zod defaults like expected/received, status numbers), plus a word limit and a one-sentence check.