refactor: await rejections on tests

This commit is contained in:
2026-02-07 23:27:20 -03:00
parent b07bc1db30
commit d4723e6a24
3 changed files with 5 additions and 5 deletions

View File

@@ -83,13 +83,13 @@ describe('PurchaseDAO', () => {
it('should throw if toDB is called with a establishmen that has no id', async () => {
sqlite.executeQuery = vi.fn().mockResolvedValue({ rows: [] });
PURCHASE_MOCK.establishment.id = undefined;
expect(service.insert(PURCHASE_MOCK)).rejects.toThrow();
await expect(service.insert(PURCHASE_MOCK)).rejects.toThrow();
});
it('should throw if toDB is called with a product that has no id', async () => {
sqlite.executeQuery = vi.fn().mockResolvedValue({ rows: [] });
PURCHASE_MOCK.product.id = undefined;
expect(service.insert(PURCHASE_MOCK)).rejects.toThrow();
await expect(service.insert(PURCHASE_MOCK)).rejects.toThrow();
});
});
});