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

@@ -216,7 +216,7 @@ describe('A LockingResourceStore', (): void => {
timeoutTrigger.emit('timeout');
await expect(prom).rejects.toThrow(new Error('timeout'));
await expect(prom).rejects.toThrow('timeout');
expect(locker.withReadLock).toHaveBeenCalledTimes(1);
expect((locker.withReadLock as jest.Mock).mock.calls[0][0]).toEqual({ path: 'path' });
expect(source.getRepresentation).toHaveBeenCalledTimes(1);