From cd061ccf25d7d35844993eeb5c47bc7b2e36e8b8 Mon Sep 17 00:00:00 2001 From: Rak Laptudirm Date: Mon, 19 Jul 2021 13:12:47 +0530 Subject: [PATCH] chore: add tests. --- Maths/test/FareyApproximation.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Maths/test/FareyApproximation.test.js diff --git a/Maths/test/FareyApproximation.test.js b/Maths/test/FareyApproximation.test.js new file mode 100644 index 000000000..bdd07eb64 --- /dev/null +++ b/Maths/test/FareyApproximation.test.js @@ -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 }) + }) +})