nano-service/tests/error.test.ts
qpismont 8283e05c02
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
bun bun bun
2024-01-30 21:50:19 +01:00

12 lines
349 B
TypeScript

import { expect, test } from "bun:test";
import { RequestError } from "../src/error";
test("request error", () => {
const expectedMsg = "This is my err";
const expectedStatusCode = 500;
const err = new RequestError(expectedMsg, expectedStatusCode);
expect(err.message).toBe(expectedMsg);
expect(err.statusCode).toBe(expectedStatusCode);
});