fix: Test error classes correctly

This commit is contained in:
Joachim Van Herwegen
2021-01-28 17:16:11 +01:00
parent a57105be8e
commit c29928c32c
18 changed files with 110 additions and 78 deletions

View File

@@ -27,7 +27,7 @@ describe('StreamUtil', (): void => {
};
const output = new PassThrough();
const piped = pipeSafely(input, output);
await expect(readableToString(piped)).rejects.toThrow(new Error('error'));
await expect(readableToString(piped)).rejects.toThrow('error');
});
it('supports mapping errors to something else.', async(): Promise<void> => {
@@ -38,7 +38,7 @@ describe('StreamUtil', (): void => {
};
const output = new PassThrough();
const piped = pipeSafely(input, output, (): any => new Error('other error'));
await expect(readableToString(piped)).rejects.toThrow(new Error('other error'));
await expect(readableToString(piped)).rejects.toThrow('other error');
});
});