2020-04-22 20:41:29 +00:00
|
|
|
import ValidationError from './validation-error';
|
|
|
|
|
|
|
|
|
|
describe('ValidationError', () => {
|
|
|
|
|
it('instantiates', () => {
|
|
|
|
|
expect(() => new ValidationError()).not.toThrow();
|
|
|
|
|
});
|
|
|
|
|
|
2020-05-01 14:52:08 +00:00
|
|
|
test.each([1, 'one', { name: '!' }])('Displays title %s', (message) => {
|
2020-04-22 20:41:29 +00:00
|
|
|
const error = new ValidationError(message);
|
|
|
|
|
|
|
|
|
|
expect(error.name).toStrictEqual('ValidationError');
|
|
|
|
|
expect(error.message).toStrictEqual(message.toString());
|
|
|
|
|
});
|
|
|
|
|
});
|