11 lines
322 B
TypeScript
11 lines
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);
|
||
|
});
|