nano-service/tests/error.test.ts

13 lines
373 B
TypeScript
Raw Normal View History

2024-01-04 21:20:47 +01:00
import { RequestError } from "../src/error.ts";
import { assertEquals } from "std/assert/mod.ts";
2024-01-04 21:20:47 +01:00
Deno.test("request error", () => {
const expectedMsg = "This is my err";
const expectedStatusCode = 500;
2024-01-04 21:20:47 +01:00
const err = new RequestError(expectedMsg, expectedStatusCode);
2024-01-04 21:20:47 +01:00
assertEquals(err.message, expectedMsg);
assertEquals(err.statusCode, expectedStatusCode);
});