Skip to content

Commit

Permalink
test: await asynchronous expect call
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Feb 21, 2025
1 parent a732367 commit 0dfdbc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions __tests__/uploader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
})
})

Expand Down Expand Up @@ -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)
})
})
})

0 comments on commit 0dfdbc1

Please sign in to comment.