mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 01:18:23 +08:00
Added test for ScrambleStrings and formatted folder structure for other folders
This commit is contained in:
11
Navigation/test/Haversine.test.js
Normal file
11
Navigation/test/Haversine.test.js
Normal 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()
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user