Skip to content

Commit

Permalink
test: more accurate and predictable DMS test
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Apr 4, 2023
1 parent ca264ad commit d73468d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/map/utils/parseDMS.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { parseDMS } from '../../../src/map/utils/parseDMS';

describe.concurrent('Parse Degrees Minutes Seconds Direction', () => {
it('Example', ({ expect }) => {
const res = parseDMS(`11°11'11.1"N 11°11'11.1"E`);
const res = parseDMS(`10°60'36.0"N 10°60'36.0"E`);

expect(res).toStrictEqual([11.186416666666666, 11.186416666666666]);
expect(res).toStrictEqual([11.01, 11.01]);
});

it('Negative Example', ({ expect }) => {
const res = parseDMS(`11°11'11.1"S 11°11'11.1"W`);
const res = parseDMS(`10°60'36.0"S 10°60'36.0"W`);

expect(res).toStrictEqual([-11.186416666666666, -11.186416666666666]);
expect(res).toStrictEqual([-11.01, -11.01]);
});
});

0 comments on commit d73468d

Please sign in to comment.