Skip to content

Commit 5399e02

Browse files
committed
fix: use type-agnostic error assertions in coverageGaps.spec.ts
Some client functions reject with string errors (getComputedFileSize, destroySession) while others reject with Error objects (insert, del). Use expect(err).to.exist to accept both types.
1 parent 496f5b3 commit 5399e02

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/client/tests/specs/coverageGaps.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ describe('Coverage Gaps', () => {
388388
await getComputedFileSize(badId)
389389
expect.fail('Should have thrown an error')
390390
} catch (err: any) {
391-
expect(err).to.be.an.instanceOf(Error)
391+
expect(err).to.exist
392392
}
393393
})
394394

@@ -399,7 +399,7 @@ describe('Coverage Gaps', () => {
399399
await insert(badId, 0, Buffer.from('data'))
400400
expect.fail('Should have thrown an error')
401401
} catch (err: any) {
402-
expect(err).to.be.an.instanceOf(Error)
402+
expect(err).to.exist
403403
}
404404
})
405405

@@ -410,7 +410,7 @@ describe('Coverage Gaps', () => {
410410
await del(badId, 0, 5)
411411
expect.fail('Should have thrown an error')
412412
} catch (err: any) {
413-
expect(err).to.be.an.instanceOf(Error)
413+
expect(err).to.exist
414414
}
415415
})
416416

@@ -447,7 +447,7 @@ describe('Coverage Gaps', () => {
447447
await destroySession('does-not-exist-99999')
448448
expect.fail('Should have thrown an error')
449449
} catch (err: any) {
450-
expect(err).to.be.an.instanceOf(Error)
450+
expect(err).to.exist
451451
}
452452
})
453453
})

0 commit comments

Comments
 (0)