mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2026-03-13 15:21:15 +08:00
added check for Integer (#1137)
This commit is contained in:
@@ -24,3 +24,9 @@ test('check BinaryCountSetBits of 0 is 0', () => {
|
||||
const res = BinaryCountSetBits(0)
|
||||
expect(res).toBe(0)
|
||||
})
|
||||
test('check BinaryCountSetBits of 21.1 throws error', () => {
|
||||
expect(() => BinaryCountSetBits(21.1)).toThrow()
|
||||
})
|
||||
test('check BinaryCountSetBits of {} throws error', () => {
|
||||
expect(() => BinaryCountSetBits({})).toThrow()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user