mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 17:50:39 +08:00
chore: add tests.
This commit is contained in:
13
Maths/test/FareyApproximation.test.js
Normal file
13
Maths/test/FareyApproximation.test.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { fareyApproximation } from "../FareyApproximation"
|
||||||
|
|
||||||
|
describe('fareyApproximation', () => {
|
||||||
|
it('Return Farey Approximation of 0.7538385', () => {
|
||||||
|
const approx = fareyApproximation(0.7538385)
|
||||||
|
expect(approx).toBe({ numerator: 22, denominator: 29 })
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Return Farey Approximation of 0.23584936', () => {
|
||||||
|
const approx = fareyApproximation(0.23584936)
|
||||||
|
expet(approx).toBe({ numerator: 13, denominator: 55 })
|
||||||
|
})
|
||||||
|
})
|
Reference in New Issue
Block a user