mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-18 09:23:55 +08:00
19 lines
534 B
JavaScript
19 lines
534 B
JavaScript
import { absVal } from '../Abs'
|
|
|
|
describe('absVal', () => {
|
|
it('should return an absolute value of a negative number', () => {
|
|
const absOfNegativeNumber = absVal(-34)
|
|
expect(absOfNegativeNumber).toBe(34)
|
|
})
|
|
|
|
it('should return an absolute value of a positive number', () => {
|
|
const absOfPositiveNumber = absVal(50)
|
|
expect(absOfPositiveNumber).toBe(50)
|
|
})
|
|
|
|
it('should return an absolute value of a zero number', () => {
|
|
const absOfPositiveNumber = absVal(0)
|
|
expect(absOfPositiveNumber).toBe(0)
|
|
})
|
|
})
|