refactor: Update eslint related dependencies

This commit is contained in:
Joachim Van Herwegen
2020-09-17 10:18:37 +02:00
parent c150da337e
commit 9657fbafb1
120 changed files with 916 additions and 605 deletions

View File

@@ -1,4 +1,4 @@
import { AsyncHandler } from '../../../src/util/AsyncHandler';
import type { AsyncHandler } from '../../../src/util/AsyncHandler';
import { StaticAsyncHandler } from '../../util/StaticAsyncHandler';
describe('An AsyncHandler', (): void => {

View File

@@ -1,4 +1,4 @@
import { AsyncHandler } from '../../../src/util/AsyncHandler';
import type { AsyncHandler } from '../../../src/util/AsyncHandler';
import { CompositeAsyncHandler } from '../../../src/util/CompositeAsyncHandler';
import { StaticAsyncHandler } from '../../util/StaticAsyncHandler';
@@ -45,6 +45,15 @@ describe('A CompositeAsyncHandler', (): void => {
await expect(handler.canHandle(null)).rejects.toThrow('[Not supported., Not supported.]');
});
it('throws unknown errors if no Error objects are thrown.', async(): Promise<void> => {
handlerFalse.canHandle = async(): Promise<void> => {
throw 'apple';
};
const handler = new CompositeAsyncHandler([ handlerFalse, handlerFalse ]);
await expect(handler.canHandle(null)).rejects.toThrow('[Unknown error., Unknown error.]');
});
it('handles data if a handler supports it.', async(): Promise<void> => {
const handler = new CompositeAsyncHandler([ handlerFalse, handlerTrue ]);