nano-service/tests/error.test.ts

13 lines
349 B
TypeScript
Raw Permalink Normal View History

2024-01-30 21:50:19 +01:00
import { expect, test } from "bun:test";
import { RequestError } from "../src/error";
2024-01-30 21:50:19 +01:00
test("request error", () => {
const expectedMsg = "This is my err";
const expectedStatusCode = 500;
2024-01-30 21:50:19 +01:00
const err = new RequestError(expectedMsg, expectedStatusCode);
2024-01-30 21:50:19 +01:00
expect(err.message).toBe(expectedMsg);
expect(err.statusCode).toBe(expectedStatusCode);
2024-01-04 21:20:47 +01:00
});