Files
JavaScript/Maths/test/IsOdd.test.js
Fahim Faisaal 98c46b4d9e merge: Improved IsOdd function (#914)
* 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
2022-03-04 16:34:33 +05:30

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)
})
})