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