fix(housekeeping): preserve frozen operation errors
This commit is contained in:
1 parent
483d5b8c67
commit
b5957015e7
2 files changed
+20
-4
No files matched your search
@@ -129,4 +129,16 @@ describe("audit command envelope", () => {
|
||||
auditOutcomeError: auditFailure,
|
||||
});
|
||||
});
|
||||
it("preserves a frozen operation error when failure evidence rejects", async () => {
|
||||
const original = Object.freeze(new Error("operation failed"));
|
||||
const writer: HousekeepingAuditWriter = {
|
||||
write: vi
|
||||
.fn()
|
||||
.mockResolvedValueOnce(undefined)
|
||||
.mockRejectedValueOnce(new Error("audit failure")),
|
||||
};
|
||||
await expect(
|
||||
runWithAuditIntent(writer, auditEntry, () => Promise.reject(original)),
|
||||
).rejects.toBe(original);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user