Skip to content

Commit f985ecf

Browse files
committed
Replace any types with proper type assertions in assert tests
1 parent 0172654 commit f985ecf

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

test/npm/assert.test.mts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ describe(
4949
it('should have correct properties', () => {
5050
try {
5151
assert(false, 'test message')
52-
} catch (e: any) {
52+
} catch (e) {
5353
expect(e instanceof assert.AssertionError).toBe(true)
5454
expect(e instanceof Error).toBe(true)
55-
expect(e.name).toBe('AssertionError')
56-
expect(e.message).toBeTruthy()
55+
expect((e as Error).name).toBe('AssertionError')
56+
expect((e as Error).message).toBeTruthy()
5757
}
5858
})
5959
})
@@ -364,7 +364,7 @@ describe(
364364
() => {
365365
throw new Error('test')
366366
},
367-
(err: any) => err instanceof Error,
367+
(err: unknown) => err instanceof Error,
368368
),
369369
).not.toThrow()
370370
})
@@ -430,8 +430,8 @@ describe(
430430
if (assert.fail) {
431431
try {
432432
assert.fail('custom message')
433-
} catch (e: any) {
434-
expect(e.message).toContain('custom')
433+
} catch (e) {
434+
expect((e as Error).message).toContain('custom')
435435
}
436436
}
437437
})

0 commit comments

Comments
 (0)