42 lines
1.0 KiB
JavaScript
Raw Permalink Normal View History

2025-06-21 23:30:33 +03:00
import { deserializeError, serializeError } from "./helpers";
describe("resiliency of deserializeError", () => {
[
0,
1,
"",
"foo",
null,
undefined,
false,
true,
Symbol("bro"),
{},
{ name: "foo" },
{ name: "foo", stack: "" },
].forEach(value => {
it("should never crashes whatever the value is " + JSON.stringify(value), () => {
expect(() => deserializeError(value)).not.toThrow();
});
});
});
describe("resiliency of serializeError", () => {
[
0,
1,
"",
"foo",
null,
undefined,
false,
true,
Symbol("bro"),
{},
{ name: "foo" },
{ name: "foo", stack: "" },
].forEach(value => {
it("should never crashes whatever the value is " + JSON.stringify(value), () => {
expect(() => serializeError(value)).not.toThrow();
});
});
});
//# sourceMappingURL=deserializeError.test.js.map