nano-service/tests/error.test.ts

11 lines
322 B
TypeScript
Raw Normal View History

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);
});