1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-30 13:58:08 +00:00
_/serialize-error/test.ts

13 lines
397 B
TypeScript

import assert from "node:assert";
import { deserializeError, serializeError } from "npm:serialize-error";
import { E } from "./main.ts";
Deno.test("serializeError", () => {
const e = serializeError(new E());
assert(e.code === "ERR");
assert(e.stack?.match(/^Error\n/));
});
Deno.test("deserializeError", () => {
assert(deserializeError({ name: "E", message: "🦄" }) instanceof E);
});