chore: add tests.

This commit is contained in:
Rak Laptudirm
2021-07-19 13:12:47 +05:30
committed by GitHub
parent a62b62dfa7
commit cd061ccf25

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