Content-Length: 1944 | pFad | http://github.com/TheAlgorithms/JavaScript/pull/1646.patch

thub.com From f49f82ca02434cbe6f3098671b53a71100d2343e Mon Sep 17 00:00:00 2001 From: Piotr Idzik Date: Mon, 25 Mar 2024 19:45:23 +0000 Subject: [PATCH] style: improve test names of `GetEuclidGCD'` --- Maths/test/GetEuclidGCD.test.js | 41 +++++++++++++++------------------ 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/Maths/test/GetEuclidGCD.test.js b/Maths/test/GetEuclidGCD.test.js index 070a8479e3..92f888acea 100644 --- a/Maths/test/GetEuclidGCD.test.js +++ b/Maths/test/GetEuclidGCD.test.js @@ -1,25 +1,22 @@ import { GetEuclidGCD, GetEuclidGCDRecursive } from '../GetEuclidGCD' -describe.each([GetEuclidGCD, GetEuclidGCDRecursive])( - '%# GetEuclidGCD', - (gcdFunction) => { - it.each([ - [5, 20, 5], - [109, 902, 1], - [290, 780, 10], - [104, 156, 52], - [0, 100, 100], - [-5, 50, 5], - [0, 0, 0], - [1, 1234567, 1] - ])('returns correct result for %i and %j', (inputA, inputB, expected) => { - expect(gcdFunction(inputA, inputB)).toBe(expected) - expect(gcdFunction(inputB, inputA)).toBe(expected) - }) +describe.each([GetEuclidGCD, GetEuclidGCDRecursive])('%o', (gcdFunction) => { + it.each([ + [5, 20, 5], + [109, 902, 1], + [290, 780, 10], + [104, 156, 52], + [0, 100, 100], + [-5, 50, 5], + [0, 0, 0], + [1, 1234567, 1] + ])('returns correct result for %i and %j', (inputA, inputB, expected) => { + expect(gcdFunction(inputA, inputB)).toBe(expected) + expect(gcdFunction(inputB, inputA)).toBe(expected) + }) - it('should throw when any of the inputs is not a number', () => { - expect(() => gcdFunction('1', 2)).toThrowError() - expect(() => gcdFunction(1, '2')).toThrowError() - }) - } -) + it('should throw when any of the inputs is not a number', () => { + expect(() => gcdFunction('1', 2)).toThrowError() + expect(() => gcdFunction(1, '2')).toThrowError() + }) +})








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/TheAlgorithms/JavaScript/pull/1646.patch

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy