mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Add metadata to errors
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { assertError, createErrorMessage, isError } from '../../../../src/util/errors/ErrorUtil';
|
||||
import { createErrorMessage, isError } from '../../../../src/util/errors/ErrorUtil';
|
||||
|
||||
describe('ErrorUtil', (): void => {
|
||||
describe('#isError', (): void => {
|
||||
@@ -19,16 +19,6 @@ describe('ErrorUtil', (): void => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#assertError', (): void => {
|
||||
it('returns undefined on native errors.', async(): Promise<void> => {
|
||||
expect(assertError(new Error('error'))).toBeUndefined();
|
||||
});
|
||||
|
||||
it('throws on other values.', async(): Promise<void> => {
|
||||
expect((): void => assertError('apple')).toThrow('apple');
|
||||
});
|
||||
});
|
||||
|
||||
describe('#createErrorMessage', (): void => {
|
||||
it('returns the given message for normal Errors.', async(): Promise<void> => {
|
||||
expect(createErrorMessage(new Error('error msg'))).toBe('error msg');
|
||||
|
||||
Reference in New Issue
Block a user