From 0dfdbc10a58cf8ac98a34fb082c07a15053a07cc Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Fri, 21 Feb 2025 10:00:41 +0100 Subject: [PATCH] test: await asynchronous expect call Signed-off-by: Ferdinand Thiessen --- __tests__/uploader.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/uploader.spec.ts b/__tests__/uploader.spec.ts index 645d33ca..0964ddc5 100644 --- a/__tests__/uploader.spec.ts +++ b/__tests__/uploader.spec.ts @@ -46,7 +46,7 @@ describe('Uploader', () => { it('fails if not logged in and not on public share', async () => { vi.spyOn(nextcloudAuth, 'getCurrentUser').mockImplementationOnce(() => null) - expect(async () => new Uploader()).rejects.toThrow(/User is not logged in/) + await expect(async () => new Uploader()).rejects.toThrow(/User is not logged in/) }) }) @@ -119,7 +119,7 @@ describe('Uploader', () => { mime: 'text/plain', }) - expect(() => { uploader.destination = newDestination as nextcloudFiles.Folder }).toThrowError(/invalid destination/i) + expect(() => { uploader.destination = newDestination as unknown as nextcloudFiles.Folder }).toThrowError(/invalid destination/i) }) }) })