mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-11 07:06:13 +08:00
15
Maths/test/Pow.test.js
Normal file
15
Maths/test/Pow.test.js
Normal file
@ -0,0 +1,15 @@
|
||||
import { pow } from '../Pow'
|
||||
|
||||
describe('Pow', () => {
|
||||
it('should return 1 for numbers with exponent 0', () => {
|
||||
expect(pow(2, 0)).toBe(1)
|
||||
})
|
||||
|
||||
it('should return 0 for numbers with base 0', () => {
|
||||
expect(pow(0, 23)).toBe(0)
|
||||
})
|
||||
|
||||
it('should return the base to the exponent power', () => {
|
||||
expect(pow(24, 4)).toBe(331776)
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user