mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-04 15:39:42 +08:00

* refactor: used Boolean function for conversion * feat: added one more function and test cases * test: refactor test case & fixed var names * chore: fixed test placeholder
26 lines
694 B
JavaScript
26 lines
694 B
JavaScript
import { isOdd, isOddBitwise } from '../IsOdd'
|
|
|
|
describe('Testing the isOdd function', () => {
|
|
it('should return true, if the number is odd', () => {
|
|
const isOddNumber = isOdd(4)
|
|
expect(isOddNumber).toBe(false)
|
|
})
|
|
|
|
it('should return true, if the number is odd', () => {
|
|
const isOddNumber = isOdd(7)
|
|
expect(isOddNumber).toBe(true)
|
|
})
|
|
})
|
|
|
|
describe('Testing the isOddBitwise function', () => {
|
|
it('should return true, if the number is odd', () => {
|
|
const isOddNumber = isOddBitwise(6)
|
|
expect(isOddNumber).toBe(false)
|
|
})
|
|
|
|
it('should return true, if the number is odd', () => {
|
|
const isOddNumber = isOddBitwise(3)
|
|
expect(isOddNumber).toBe(true)
|
|
})
|
|
})
|