Skip to content

Commit

Permalink
[test] add test case calculating distance between two sets of coordin…
Browse files Browse the repository at this point in the history
…ates
  • Loading branch information
mrhyde committed Sep 7, 2023
1 parent 836f026 commit 4b6eb0c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions source/airports/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,21 @@ describe('airports', () => {
})

describe('calculateDistance', () => {
it('when passed two set of coordinates \n\t Then should calculate distance between them', async () => {

Check failure on line 141 in source/airports/integration.test.ts

View workflow job for this annotation

GitHub Actions / node@18

Async arrow function has no 'await' expression

Check failure on line 141 in source/airports/integration.test.ts

View workflow job for this annotation

GitHub Actions / node@20

Async arrow function has no 'await' expression
expect.assertions(2)
const from = {
latitude: 52.3667,
longitude: 13.5033
} // Berlin airport
const to = {
latitude: 50.0777,
longitude: 19.7848
} // Krakow airport
const distance = airports.calculateDistance([from, to])

expect(distance).toBeGreaterThan(505800)
expect(distance).toBeLessThan(506000)
})
it('when passed two airport objects \n\t Then should calculate distance between them', async () => {
expect.assertions(2)
const activeAirports = await airports.getActive()
Expand Down

0 comments on commit 4b6eb0c

Please sign in to comment.