@@ -17,7 +17,45 @@ describe('Geometry', () => {
17
17
test ( 'calculates the circumference of a circle' , ( ) => {
18
18
expect ( Geometry . circleCircumference ( 3 ) ) . toBeCloseTo ( 18.850 , 3 ) ;
19
19
} ) ;
20
-
20
+ test ( 'calculates the area of a triangle' , ( ) => {
21
+ expect ( Geometry . triangleArea ( 3 , 4 ) ) . toBe ( 6 ) ;
22
+ } ) ;
23
+ test ( 'calculates the volume of a sphere' , ( ) => {
24
+ expect ( Geometry . sphereVolume ( 3 ) ) . toBeCloseTo ( 113.097 , 3 ) ;
25
+ } ) ;
26
+ test ( 'calculates the area of an equilateral triangle' , ( ) => {
27
+ expect ( Geometry . equilateralTriangleArea ( 3 ) ) . toBeCloseTo ( 3.897 , 3 ) ;
28
+ } ) ;
29
+ test ( 'calculates the area of a triangle given its side lengths' , ( ) => {
30
+ expect ( Geometry . triangleArea_sides ( 3 , 4 , 5 ) ) . toBe ( 6 ) ;
31
+ } ) ;
32
+ test ( 'calculates the area of a square given its side length' , ( ) => {
33
+ expect ( Geometry . squareArea ( 3 ) ) . toBe ( 9 ) ;
34
+ } ) ;
35
+ test ( 'calculates the perimeter of a square given its side length' , ( ) => {
36
+ expect ( Geometry . squarePerimeter ( 3 ) ) . toBe ( 12 ) ;
37
+ } ) ;
38
+ test ( 'calculates the volume of a cube given its side length' , ( ) => {
39
+ expect ( Geometry . cubeVolume ( 3 ) ) . toBe ( 27 ) ;
40
+ } ) ;
41
+ test ( 'calculates the volume of a rectangular prism given length, width, and height' , ( ) => {
42
+ expect ( Geometry . rectangularPrismVolume ( 3 , 4 , 5 ) ) . toBe ( 60 ) ;
43
+ } ) ;
44
+ test ( 'calculates the surface area of a rectangular prism given length, width, and height' , ( ) => {
45
+ expect ( Geometry . rectangularPrismSurfaceArea ( 3 , 4 , 5 ) ) . toBe ( 94 ) ;
46
+ } ) ;
47
+ test ( 'calculates the volume of a cylinder given radius and height' , ( ) => {
48
+ expect ( Geometry . cylinderVolume ( 3 , 5 ) ) . toBeCloseTo ( 141.371 , 3 ) ;
49
+ } ) ;
50
+ test ( 'calculates the surface area of a cylinder given radius and height' , ( ) => {
51
+ expect ( Geometry . cylinderSurfaceArea ( 3 , 5 ) ) . toBeCloseTo ( 150.796 , 3 ) ;
52
+ } ) ;
53
+ test ( 'calculates the volume of a cone given radius and height' , ( ) => {
54
+ expect ( Geometry . coneVolume ( 3 , 5 ) ) . toBeCloseTo ( 47.123 , 3 ) ;
55
+ } ) ;
56
+ test ( 'calculates the surface area of a cone given radius and height' , ( ) => {
57
+ expect ( Geometry . coneSurfaceArea ( 3 , 5 ) ) . toBeCloseTo ( 83.229 , 3 ) ;
58
+ } ) ;
21
59
// Add more test cases as needed
22
60
} ) ;
23
61
0 commit comments