12 lines
373 B
TypeScript
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);
|
|
});
|