nano-service/tests/error.test.ts
2023-10-19 23:27:51 +02:00

11 lines
No EOL
322 B
TypeScript

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