mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2026-03-13 15:21:15 +08:00
algorithm class: circle (#1252)
This commit is contained in:
11
Geometry/Test/Circle.test.js
Normal file
11
Geometry/Test/Circle.test.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import Circle from '../Circle'
|
||||
|
||||
const circle = new Circle(3)
|
||||
|
||||
test('The area of a circle with radius equal to 3', () => {
|
||||
expect(parseFloat(circle.area().toFixed(2))).toEqual(28.27)
|
||||
})
|
||||
|
||||
test('The perimeter of a circle with radius equal to 3', () => {
|
||||
expect(parseFloat(circle.perimeter().toFixed(2))).toEqual(18.85)
|
||||
})
|
||||
Reference in New Issue
Block a user