mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Rename UnsupportedHttpError into BadRequestError.
This commit is contained in:
committed by
Joachim Van Herwegen
parent
03ffaaed43
commit
af8f1976cd
17
test/unit/util/errors/BadRequestHttpError.test.ts
Normal file
17
test/unit/util/errors/BadRequestHttpError.test.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { BadRequestHttpError } from '../../../../src/util/errors/BadRequestHttpError';
|
||||
|
||||
describe('An BadRequestHttpError', (): void => {
|
||||
it('has status code 400.', async(): Promise<void> => {
|
||||
const error = new BadRequestHttpError('test');
|
||||
|
||||
expect(error.statusCode).toEqual(400);
|
||||
expect(error.message).toEqual('test');
|
||||
expect(error.name).toEqual('BadRequestHttpError');
|
||||
});
|
||||
|
||||
it('has a default message if none was provided.', async(): Promise<void> => {
|
||||
const error = new BadRequestHttpError();
|
||||
|
||||
expect(error.message).toEqual('The given input is not supported by the server configuration.');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user