test: remove duplicate result assertions before throwing guards
This commit is contained in:
@@ -5,7 +5,6 @@ import { safeParseJson } from "./safeJson.js";
|
||||
it("keeps the original JSON parse failure as the cause", () => {
|
||||
const parsed = safeParseJson("{");
|
||||
|
||||
expect(parsed.ok).toBe(false);
|
||||
if (parsed.ok) throw new Error("expected invalid JSON to fail");
|
||||
expect(parsed.error).toContain("JSON");
|
||||
expect(parsed.cause).toBeInstanceOf(SyntaxError);
|
||||
|
||||
Reference in New Issue
Block a user