Added test for ScrambleStrings and formatted folder structure for other folders

This commit is contained in:
Omkarnath Parida
2021-10-03 17:28:17 +05:30
parent 255ef9a50d
commit c198a9f53d
12 changed files with 26 additions and 11 deletions

View File

@ -0,0 +1,11 @@
import { haversineDistance } from '../Haversine'
describe('Testing the haversine distance calculator', () => {
it('Calculate distance', () => {
const distance = haversineDistance(64.1265, -21.8174, 40.7128, -74.0060)
expect(distance).toBe(4208198.758424171)
})
it('Test validation, expect throw', () => {
expect(() => haversineDistance(64.1265, -21.8174, 40.7128, '74.0060')).toThrow()
})
})