nano-service/tests/error.test.ts
2024-01-04 21:20:47 +01:00

12 lines
373 B
TypeScript

import { RequestError } from "../src/error.ts";
import { assertEquals } from "std/assert/mod.ts";
Deno.test("request error", () => {
const expectedMsg = "This is my err";
const expectedStatusCode = 500;
const err = new RequestError(expectedMsg, expectedStatusCode);
assertEquals(err.message, expectedMsg);
assertEquals(err.statusCode, expectedStatusCode);
});