mirror of
https://github.com/morluto/rea.git
synced 2026-12-04 10:04:50 +00:00
test(providers): assert the specific refusal behind each bare toThrow (#15528)
* test(providers): assert the specific refusal behind each bare toThrow Replace bare toThrow() in adapter, artifact, parser and server tests with the errno code of a removed path or closed descriptor, the Zod issue path and code per case, the parse failure kind and message or reason per case, the cleanup retry failure and the resources it still holds, or the contract message each refusal reports. * test(artifacts,ghidra): assert retained cleanup resources instead of their message * test(artifacts): assert the keyed-archive truncation as its parse failure facts
This commit is contained in:
1 parent
58bd0febff
commit
9fabd0323f
20 files changed
+259
-90
No files matched your search
@@ -290,12 +290,23 @@ describe("source-map section-boundary candidates", () => {
|
||||
});
|
||||
|
||||
describe("source-map layout admission", () => {
|
||||
it.each(["g", "!", "AA", "D"])(
|
||||
"rejects malformed VLQ/components: %s",
|
||||
(mappings) => {
|
||||
expect(() => trace({ ...leaf, mappings })).toThrow();
|
||||
},
|
||||
);
|
||||
it.each([
|
||||
["g", "Source-map VLQ ends with an unfinished continuation."],
|
||||
["!", expect.stringContaining('"mappings"')],
|
||||
["AA", "Source-map segment requires one, four or five VLQ components."],
|
||||
[
|
||||
"D",
|
||||
"Decoded local or absolute position, source index or name index is invalid.",
|
||||
],
|
||||
])("rejects malformed VLQ/components: %s", (mappings, message) => {
|
||||
expect(() => trace({ ...leaf, mappings })).toThrow(
|
||||
expect.objectContaining({
|
||||
_tag: "ParseFailureError",
|
||||
kind: "malformed",
|
||||
message,
|
||||
}),
|
||||
);
|
||||
});
|
||||
it.each([",", ",AAAA", "AAAA,,A", "AAAA,", "AAAA,;A"])(
|
||||
"rejects empty mapping segments around commas: %s",
|
||||
(mappings) => {
|
||||
|
||||
Reference in new issue
Block a user