From ab761ec892accdd5cd99f5d918edf9b775716277 Mon Sep 17 00:00:00 2001 From: leeyan44 <86589062+leeyan44@users.noreply.github.com> Date: Tue, 20 Jul 2021 14:14:53 +0800 Subject: [PATCH 1/6] Added Volume.test.js file Volume.test.js file is to test on the calculations for the Volume.js file. --- Maths/test/Volume.test.js | 139 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 Maths/test/Volume.test.js diff --git a/Maths/test/Volume.test.js b/Maths/test/Volume.test.js new file mode 100644 index 000000000..62741d2e3 --- /dev/null +++ b/Maths/test/Volume.test.js @@ -0,0 +1,139 @@ +import * as volume from '../Volume' + +test('Testing on volCuboid', () => { + it('with correct args', () => { + const volCuboid = volume.volCuboid(2.0, 5.0, 3) + expect(volCuboid).toBe(30.0) + }) + it('with incorrect args', () => { + expect(() => volume.volCuboid(-1, 5.0, 3)).toThrow() + expect(() => volume.volCuboid(2.0, -1, 3)).toThrow() + expect(() => volume.volCuboid(2.0, 5.0, -1)).toThrow() + expect(() => volume.volCuboid('2.0', 5.0, 3)).toThrow() + expect(() => volume.volCuboid(2.0, '5.0', 3)).toThrow() + expect(() => volume.volCuboid(2.0, 5.0, '3')).toThrow() + expect(() => volume.volCuboid(2000000000000000, 5.0, 3)).toThrow() + expect(() => volume.volCuboid(2.0, 500000000000000000, 3)).toThrow() + expect(() => volume.volCuboid(2.0, 5.0, 30000000000000000000)).toThrow() + }) +}) + +test('Testing on volCube', () => { + it('with correct args', () => { + const volCube = volume.volCube(2.0) + expect(volCube).toBe(8.0) + }) + it('with incorrect args', () => { + expect(() => volume.volCube(-2.0)).toThrow() + expect(() => volume.volCube('2.0')).toThrow() + expect(() => volume.volCube(2000000000000000000000000)).toThrow() + }) +}) + +test('Testing on volCone', () => { + it('with correct args', () => { + const volCone = volume.volCone(2.0, 8.0) + expect(volCone).toBe(33.5103) + }) + it('with incorrect args', () => { + expect(() => volume.volCone(-2.0, 8.0)).toThrow() + expect(() => volume.volCone(2.0, -8.0)).toThrow() + expect(() => volume.volCone('2.0', 8.0)).toThrow() + expect(() => volume.volCone(2.0, '8.0')).toThrow() + expect(() => volume.volCone(2000000000000000000000000, 8.0)).toThrow() + expect(() => volume.volCone(2.0, 8000000000000000000000000000)).toThrow() + }) +}) + +test('Testing on volPyramid', () => { + it('with correct args', () => { + const volPyramid = volume.volPyramid(2.0, 3.0, 8.0) + expect(volPyramid).toBe(16.0) + }) + it('with incorrect args', () => { + expect(() => volume.volPyramid(-2.0, 3.0, 8.0)).toThrow() + expect(() => volume.volPyramid(2.0, -3.0, 8.0)).toThrow() + expect(() => volume.volPyramid(2.0, 3.0, -8.0)).toThrow() + expect(() => volume.volPyramid('2.0', 3.0, 8.0)).toThrow() + expect(() => volume.volPyramid(2.0, '3.0', 8.0)).toThrow() + expect(() => volume.volPyramid(2.0, 3.0, '8.0')).toThrow() + expect(() => volume.volPyramid(2000000000000000000000000, 3.0, 8.0)).toThrow() + expect(() => volume.volPyramid(2.0, 3000000000000000000000000000, 8.0)).toThrow() + expect(() => volume.volPyramid(2.0, 3.0, 8000000000000000000000000000)).toThrow() + }) +}) + +test('Testing on volCylinder', () => { + it('with correct args', () => { + const volCylinder = volume.volCylinder(2.0, 8.0) + expect(volCylinder).toBe(100.5310) + }) + it('with incorrect args', () => { + expect(() => volume.volCylinder(-2.0, 8.0)).toThrow() + expect(() => volume.volCylinder(2.0, -8.0)).toThrow() + expect(() => volume.volCylinder('2.0', 8.0)).toThrow() + expect(() => volume.volCylinder(2.0, '8.0')).toThrow() + expect(() => volume.volCylinder(2000000000000000000000000, 8.0)).toThrow() + expect(() => volume.volCylinder(2.0, 8000000000000000000000000000)).toThrow() + }) +}) + +test('Testing on volTriangularPrism', () => { + it('with correct args', () => { + const volTriangularPrism = volume.volTriangularPrism(3.0, 6.0, 8.0) + expect(volTriangularPrism).toBe(72.0) + }) + it('with incorrect args', () => { + expect(() => volume.volTriangularPrism(-3.0, 6.0, 8.0)).toThrow() + expect(() => volume.volTriangularPrism(3.0, -6.0, 8.0)).toThrow() + expect(() => volume.volTriangularPrism(3.0, 6.0, -8.0)).toThrow() + expect(() => volume.volTriangularPrism('3.0', 6.0, 8.0)).toThrow() + expect(() => volume.volTriangularPrism(3.0, '6.0', 8.0)).toThrow() + expect(() => volume.volTriangularPrism(3.0, 6.0, '8.0')).toThrow() + expect(() => volume.volTriangularPrism(3000000000000000000000000, 6.0, 8.0)).toThrow() + expect(() => volume.volTriangularPrism(3.0, 6000000000000000000000000000, 8.0)).toThrow() + expect(() => volume.volTriangularPrism(3.0, 6.0, 8000000000000000000000000000)).toThrow() + }) +}) + +test('Testing on volPentagonalPrism', () => { + it('with correct args', () => { + const volPentagonalPrism = volume.volPentagonalPrism(1.0, 4.0, 8.0) + expect(volPentagonalPrism).toBe(80.0) + }) + it('with incorrect args', () => { + expect(() => volume.volPentagonalPrism(-1.0, 4.0, 8.0)).toThrow() + expect(() => volume.volPentagonalPrism(1.0, -4.0, 8.0)).toThrow() + expect(() => volume.volPentagonalPrism(1.0, 4.0, -8.0)).toThrow() + expect(() => volume.volPentagonalPrism('1.0', 4.0, 8.0)).toThrow() + expect(() => volume.volPentagonalPrism(1.0, '4.0', 8.0)).toThrow() + expect(() => volume.volPentagonalPrism(1.0, 4.0, '8.0')).toThrow() + expect(() => volume.volPentagonalPrism(1000000000000000000000000, 4.0, 8.0)).toThrow() + expect(() => volume.volPentagonalPrism(1.0, 4000000000000000000000000000, 8.0)).toThrow() + expect(() => volume.volPentagonalPrism(1.0, 4.0, 8000000000000000000000000000)).toThrow() + }) +}) + +test('Testing on volSphere', () => { + it('with correct args', () => { + const volSphere = volume.volSphere(4.0) + expect(volSphere).toBe(268.0826) + }) + it('with incorrect args', () => { + expect(() => volume.volSphere(-4.0)).toThrow() + expect(() => volume.volSphere('4.0')).toThrow() + expect(() => volume.volSphere(4000000000000000000000000)).toThrow() + }) +}) + +test('Testing on volHemisphere', () => { + it('with correct args', () => { + const volHemisphere = volume.volHemisphere(4.0) + expect(volHemisphere).toBe(134.0413) + }) + it('with incorrect args', () => { + expect(() => volume.volHemisphere(-4.0)).toThrow() + expect(() => volume.volHemisphere('4.0')).toThrow() + expect(() => volume.volHemisphere(4000000000000000000000000)).toThrow() + }) +}) From 45cde7a4aac6036b2853262a0163cbb45108950d Mon Sep 17 00:00:00 2001 From: leeyan44 <86589062+leeyan44@users.noreply.github.com> Date: Tue, 20 Jul 2021 14:25:24 +0800 Subject: [PATCH 2/6] Update Volume.test.js --- Maths/test/Volume.test.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Maths/test/Volume.test.js b/Maths/test/Volume.test.js index 62741d2e3..eca4022cf 100644 --- a/Maths/test/Volume.test.js +++ b/Maths/test/Volume.test.js @@ -1,6 +1,6 @@ import * as volume from '../Volume' -test('Testing on volCuboid', () => { +describe('Testing on volCuboid', () => { it('with correct args', () => { const volCuboid = volume.volCuboid(2.0, 5.0, 3) expect(volCuboid).toBe(30.0) @@ -18,7 +18,7 @@ test('Testing on volCuboid', () => { }) }) -test('Testing on volCube', () => { +describe('Testing on volCube', () => { it('with correct args', () => { const volCube = volume.volCube(2.0) expect(volCube).toBe(8.0) @@ -30,7 +30,7 @@ test('Testing on volCube', () => { }) }) -test('Testing on volCone', () => { +describe('Testing on volCone', () => { it('with correct args', () => { const volCone = volume.volCone(2.0, 8.0) expect(volCone).toBe(33.5103) @@ -45,7 +45,7 @@ test('Testing on volCone', () => { }) }) -test('Testing on volPyramid', () => { +describe('Testing on volPyramid', () => { it('with correct args', () => { const volPyramid = volume.volPyramid(2.0, 3.0, 8.0) expect(volPyramid).toBe(16.0) @@ -63,7 +63,7 @@ test('Testing on volPyramid', () => { }) }) -test('Testing on volCylinder', () => { +describe('Testing on volCylinder', () => { it('with correct args', () => { const volCylinder = volume.volCylinder(2.0, 8.0) expect(volCylinder).toBe(100.5310) @@ -78,7 +78,7 @@ test('Testing on volCylinder', () => { }) }) -test('Testing on volTriangularPrism', () => { +describe('Testing on volTriangularPrism', () => { it('with correct args', () => { const volTriangularPrism = volume.volTriangularPrism(3.0, 6.0, 8.0) expect(volTriangularPrism).toBe(72.0) @@ -96,7 +96,7 @@ test('Testing on volTriangularPrism', () => { }) }) -test('Testing on volPentagonalPrism', () => { +describe('Testing on volPentagonalPrism', () => { it('with correct args', () => { const volPentagonalPrism = volume.volPentagonalPrism(1.0, 4.0, 8.0) expect(volPentagonalPrism).toBe(80.0) @@ -114,7 +114,7 @@ test('Testing on volPentagonalPrism', () => { }) }) -test('Testing on volSphere', () => { +describe('Testing on volSphere', () => { it('with correct args', () => { const volSphere = volume.volSphere(4.0) expect(volSphere).toBe(268.0826) @@ -126,7 +126,7 @@ test('Testing on volSphere', () => { }) }) -test('Testing on volHemisphere', () => { +describe('Testing on volHemisphere', () => { it('with correct args', () => { const volHemisphere = volume.volHemisphere(4.0) expect(volHemisphere).toBe(134.0413) From 48fec3d571f25a0caec2ca31c1f06d86b1321dcd Mon Sep 17 00:00:00 2001 From: leeyan44 <86589062+leeyan44@users.noreply.github.com> Date: Tue, 20 Jul 2021 14:41:25 +0800 Subject: [PATCH 3/6] Update Volume.test.js --- Maths/test/Volume.test.js | 111 ++++---------------------------------- 1 file changed, 9 insertions(+), 102 deletions(-) diff --git a/Maths/test/Volume.test.js b/Maths/test/Volume.test.js index eca4022cf..66fcf066c 100644 --- a/Maths/test/Volume.test.js +++ b/Maths/test/Volume.test.js @@ -1,139 +1,46 @@ import * as volume from '../Volume' -describe('Testing on volCuboid', () => { - it('with correct args', () => { +test('Testing on volCuboid', () => { const volCuboid = volume.volCuboid(2.0, 5.0, 3) expect(volCuboid).toBe(30.0) - }) - it('with incorrect args', () => { - expect(() => volume.volCuboid(-1, 5.0, 3)).toThrow() - expect(() => volume.volCuboid(2.0, -1, 3)).toThrow() - expect(() => volume.volCuboid(2.0, 5.0, -1)).toThrow() - expect(() => volume.volCuboid('2.0', 5.0, 3)).toThrow() - expect(() => volume.volCuboid(2.0, '5.0', 3)).toThrow() - expect(() => volume.volCuboid(2.0, 5.0, '3')).toThrow() - expect(() => volume.volCuboid(2000000000000000, 5.0, 3)).toThrow() - expect(() => volume.volCuboid(2.0, 500000000000000000, 3)).toThrow() - expect(() => volume.volCuboid(2.0, 5.0, 30000000000000000000)).toThrow() - }) }) -describe('Testing on volCube', () => { - it('with correct args', () => { +test('Testing on volCube', () => { const volCube = volume.volCube(2.0) expect(volCube).toBe(8.0) - }) - it('with incorrect args', () => { - expect(() => volume.volCube(-2.0)).toThrow() - expect(() => volume.volCube('2.0')).toThrow() - expect(() => volume.volCube(2000000000000000000000000)).toThrow() - }) }) -describe('Testing on volCone', () => { - it('with correct args', () => { +test('Testing on volCone', () => { const volCone = volume.volCone(2.0, 8.0) expect(volCone).toBe(33.5103) - }) - it('with incorrect args', () => { - expect(() => volume.volCone(-2.0, 8.0)).toThrow() - expect(() => volume.volCone(2.0, -8.0)).toThrow() - expect(() => volume.volCone('2.0', 8.0)).toThrow() - expect(() => volume.volCone(2.0, '8.0')).toThrow() - expect(() => volume.volCone(2000000000000000000000000, 8.0)).toThrow() - expect(() => volume.volCone(2.0, 8000000000000000000000000000)).toThrow() - }) }) -describe('Testing on volPyramid', () => { - it('with correct args', () => { +test('Testing on volPyramid', () => { const volPyramid = volume.volPyramid(2.0, 3.0, 8.0) expect(volPyramid).toBe(16.0) - }) - it('with incorrect args', () => { - expect(() => volume.volPyramid(-2.0, 3.0, 8.0)).toThrow() - expect(() => volume.volPyramid(2.0, -3.0, 8.0)).toThrow() - expect(() => volume.volPyramid(2.0, 3.0, -8.0)).toThrow() - expect(() => volume.volPyramid('2.0', 3.0, 8.0)).toThrow() - expect(() => volume.volPyramid(2.0, '3.0', 8.0)).toThrow() - expect(() => volume.volPyramid(2.0, 3.0, '8.0')).toThrow() - expect(() => volume.volPyramid(2000000000000000000000000, 3.0, 8.0)).toThrow() - expect(() => volume.volPyramid(2.0, 3000000000000000000000000000, 8.0)).toThrow() - expect(() => volume.volPyramid(2.0, 3.0, 8000000000000000000000000000)).toThrow() - }) }) -describe('Testing on volCylinder', () => { - it('with correct args', () => { +test('Testing on volCylinder', () => { const volCylinder = volume.volCylinder(2.0, 8.0) expect(volCylinder).toBe(100.5310) - }) - it('with incorrect args', () => { - expect(() => volume.volCylinder(-2.0, 8.0)).toThrow() - expect(() => volume.volCylinder(2.0, -8.0)).toThrow() - expect(() => volume.volCylinder('2.0', 8.0)).toThrow() - expect(() => volume.volCylinder(2.0, '8.0')).toThrow() - expect(() => volume.volCylinder(2000000000000000000000000, 8.0)).toThrow() - expect(() => volume.volCylinder(2.0, 8000000000000000000000000000)).toThrow() - }) }) -describe('Testing on volTriangularPrism', () => { - it('with correct args', () => { +test('Testing on volTriangularPrism', () => { const volTriangularPrism = volume.volTriangularPrism(3.0, 6.0, 8.0) expect(volTriangularPrism).toBe(72.0) - }) - it('with incorrect args', () => { - expect(() => volume.volTriangularPrism(-3.0, 6.0, 8.0)).toThrow() - expect(() => volume.volTriangularPrism(3.0, -6.0, 8.0)).toThrow() - expect(() => volume.volTriangularPrism(3.0, 6.0, -8.0)).toThrow() - expect(() => volume.volTriangularPrism('3.0', 6.0, 8.0)).toThrow() - expect(() => volume.volTriangularPrism(3.0, '6.0', 8.0)).toThrow() - expect(() => volume.volTriangularPrism(3.0, 6.0, '8.0')).toThrow() - expect(() => volume.volTriangularPrism(3000000000000000000000000, 6.0, 8.0)).toThrow() - expect(() => volume.volTriangularPrism(3.0, 6000000000000000000000000000, 8.0)).toThrow() - expect(() => volume.volTriangularPrism(3.0, 6.0, 8000000000000000000000000000)).toThrow() - }) }) -describe('Testing on volPentagonalPrism', () => { - it('with correct args', () => { +test('Testing on volPentagonalPrism', () => { const volPentagonalPrism = volume.volPentagonalPrism(1.0, 4.0, 8.0) expect(volPentagonalPrism).toBe(80.0) - }) - it('with incorrect args', () => { - expect(() => volume.volPentagonalPrism(-1.0, 4.0, 8.0)).toThrow() - expect(() => volume.volPentagonalPrism(1.0, -4.0, 8.0)).toThrow() - expect(() => volume.volPentagonalPrism(1.0, 4.0, -8.0)).toThrow() - expect(() => volume.volPentagonalPrism('1.0', 4.0, 8.0)).toThrow() - expect(() => volume.volPentagonalPrism(1.0, '4.0', 8.0)).toThrow() - expect(() => volume.volPentagonalPrism(1.0, 4.0, '8.0')).toThrow() - expect(() => volume.volPentagonalPrism(1000000000000000000000000, 4.0, 8.0)).toThrow() - expect(() => volume.volPentagonalPrism(1.0, 4000000000000000000000000000, 8.0)).toThrow() - expect(() => volume.volPentagonalPrism(1.0, 4.0, 8000000000000000000000000000)).toThrow() - }) }) -describe('Testing on volSphere', () => { - it('with correct args', () => { +test('Testing on volSphere', () => { const volSphere = volume.volSphere(4.0) expect(volSphere).toBe(268.0826) - }) - it('with incorrect args', () => { - expect(() => volume.volSphere(-4.0)).toThrow() - expect(() => volume.volSphere('4.0')).toThrow() - expect(() => volume.volSphere(4000000000000000000000000)).toThrow() - }) }) -describe('Testing on volHemisphere', () => { - it('with correct args', () => { +test('Testing on volHemisphere', () => { const volHemisphere = volume.volHemisphere(4.0) expect(volHemisphere).toBe(134.0413) - }) - it('with incorrect args', () => { - expect(() => volume.volHemisphere(-4.0)).toThrow() - expect(() => volume.volHemisphere('4.0')).toThrow() - expect(() => volume.volHemisphere(4000000000000000000000000)).toThrow() - }) }) From fe5e939bb953ffd1ac5fda5626415881071cb30a Mon Sep 17 00:00:00 2001 From: leeyan44 <86589062+leeyan44@users.noreply.github.com> Date: Tue, 20 Jul 2021 14:52:19 +0800 Subject: [PATCH 4/6] Update Volume.test.js --- Maths/test/Volume.test.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Maths/test/Volume.test.js b/Maths/test/Volume.test.js index 66fcf066c..667646c04 100644 --- a/Maths/test/Volume.test.js +++ b/Maths/test/Volume.test.js @@ -1,46 +1,46 @@ import * as volume from '../Volume' test('Testing on volCuboid', () => { - const volCuboid = volume.volCuboid(2.0, 5.0, 3) - expect(volCuboid).toBe(30.0) + const volCuboid = volume.volCuboid(2.0, 5.0, 3) + expect(volCuboid).toBe(30.0) }) test('Testing on volCube', () => { - const volCube = volume.volCube(2.0) - expect(volCube).toBe(8.0) + const volCube = volume.volCube(2.0) + expect(volCube).toBe(8.0) }) test('Testing on volCone', () => { - const volCone = volume.volCone(2.0, 8.0) - expect(volCone).toBe(33.5103) + const volCone = volume.volCone(2.0, 8.0) + expect(volCone).toBe(33.5103) }) test('Testing on volPyramid', () => { - const volPyramid = volume.volPyramid(2.0, 3.0, 8.0) - expect(volPyramid).toBe(16.0) + const volPyramid = volume.volPyramid(2.0, 3.0, 8.0) + expect(volPyramid).toBe(16.0) }) test('Testing on volCylinder', () => { - const volCylinder = volume.volCylinder(2.0, 8.0) - expect(volCylinder).toBe(100.5310) + const volCylinder = volume.volCylinder(2.0, 8.0) + expect(volCylinder).toBe(100.5310) }) test('Testing on volTriangularPrism', () => { - const volTriangularPrism = volume.volTriangularPrism(3.0, 6.0, 8.0) - expect(volTriangularPrism).toBe(72.0) + const volTriangularPrism = volume.volTriangularPrism(3.0, 6.0, 8.0) + expect(volTriangularPrism).toBe(72.0) }) test('Testing on volPentagonalPrism', () => { - const volPentagonalPrism = volume.volPentagonalPrism(1.0, 4.0, 8.0) - expect(volPentagonalPrism).toBe(80.0) + const volPentagonalPrism = volume.volPentagonalPrism(1.0, 4.0, 8.0) + expect(volPentagonalPrism).toBe(80.0) }) test('Testing on volSphere', () => { - const volSphere = volume.volSphere(4.0) - expect(volSphere).toBe(268.0826) + const volSphere = volume.volSphere(4.0) + expect(volSphere).toBe(268.0826) }) test('Testing on volHemisphere', () => { - const volHemisphere = volume.volHemisphere(4.0) - expect(volHemisphere).toBe(134.0413) + const volHemisphere = volume.volHemisphere(4.0) + expect(volHemisphere).toBe(134.0413) }) From 5d62b4aa1b768bc993e965081d036d0fb866ed65 Mon Sep 17 00:00:00 2001 From: leeyan44 <86589062+leeyan44@users.noreply.github.com> Date: Tue, 20 Jul 2021 15:03:22 +0800 Subject: [PATCH 5/6] Update Volume.test.js --- Maths/test/Volume.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Maths/test/Volume.test.js b/Maths/test/Volume.test.js index 667646c04..46cf42c6b 100644 --- a/Maths/test/Volume.test.js +++ b/Maths/test/Volume.test.js @@ -11,8 +11,8 @@ test('Testing on volCube', () => { }) test('Testing on volCone', () => { - const volCone = volume.volCone(2.0, 8.0) - expect(volCone).toBe(33.5103) + const volCone = volume.volCone(3.0, 8.0) + expect(volCone).toBe(75.39822) }) test('Testing on volPyramid', () => { @@ -21,8 +21,8 @@ test('Testing on volPyramid', () => { }) test('Testing on volCylinder', () => { - const volCylinder = volume.volCylinder(2.0, 8.0) - expect(volCylinder).toBe(100.5310) + const volCylinder = volume.volCylinder(3.0, 8.0) + expect(volCylinder).toBe(226.19467) }) test('Testing on volTriangularPrism', () => { @@ -37,10 +37,10 @@ test('Testing on volPentagonalPrism', () => { test('Testing on volSphere', () => { const volSphere = volume.volSphere(4.0) - expect(volSphere).toBe(268.0826) + expect(volSphere).toBe(268.08257) }) test('Testing on volHemisphere', () => { const volHemisphere = volume.volHemisphere(4.0) - expect(volHemisphere).toBe(134.0413) + expect(volHemisphere).toBe(134.041285) }) From 23714cb154692d37708ca6c8eb65cc3ac7968f37 Mon Sep 17 00:00:00 2001 From: leeyan44 <86589062+leeyan44@users.noreply.github.com> Date: Tue, 20 Jul 2021 15:08:31 +0800 Subject: [PATCH 6/6] Update Volume.test.js --- Maths/test/Volume.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Maths/test/Volume.test.js b/Maths/test/Volume.test.js index 46cf42c6b..e45235eb6 100644 --- a/Maths/test/Volume.test.js +++ b/Maths/test/Volume.test.js @@ -12,7 +12,7 @@ test('Testing on volCube', () => { test('Testing on volCone', () => { const volCone = volume.volCone(3.0, 8.0) - expect(volCone).toBe(75.39822) + expect(volCone).toBe(75.39822368615503) }) test('Testing on volPyramid', () => { @@ -22,7 +22,7 @@ test('Testing on volPyramid', () => { test('Testing on volCylinder', () => { const volCylinder = volume.volCylinder(3.0, 8.0) - expect(volCylinder).toBe(226.19467) + expect(volCylinder).toBe(226.1946710584651) }) test('Testing on volTriangularPrism', () => { @@ -37,10 +37,10 @@ test('Testing on volPentagonalPrism', () => { test('Testing on volSphere', () => { const volSphere = volume.volSphere(4.0) - expect(volSphere).toBe(268.08257) + expect(volSphere).toBe(268.082573106329) }) test('Testing on volHemisphere', () => { const volHemisphere = volume.volHemisphere(4.0) - expect(volHemisphere).toBe(134.041285) + expect(volHemisphere).toBe(134.0412865531645) })