mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2026-03-13 15:21:15 +08:00
Added jest file in tests, added description and normal even number test(divisibility by 2 )
This commit is contained in:
21
Maths/test/IsEven.test.js
Normal file
21
Maths/test/IsEven.test.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { isEven, isEvenBitwise } from '../IsEven'
|
||||
|
||||
test('should return if the number is even or not', () => {
|
||||
const isEvenNumber = isEven(4)
|
||||
expect(isEvenNumber).toBe(true)
|
||||
})
|
||||
|
||||
test('should return if the number is even or not', () => {
|
||||
const isEvenNumber = isEven(7)
|
||||
expect(isEvenNumber).toBe(false)
|
||||
})
|
||||
|
||||
test('should return if the number is even or not', () => {
|
||||
const isEvenNumber = isEvenBitwise(6)
|
||||
expect(isEvenNumber).toBe(true)
|
||||
})
|
||||
|
||||
test('should return if the number is even or not', () => {
|
||||
const isEvenNumber = isEvenBitwise(3)
|
||||
expect(isEvenNumber).toBe(false)
|
||||
})
|
||||
Reference in New Issue
Block a user