Skip to content

Commit

Permalink
test: add parseDMS
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Apr 4, 2023
1 parent 99dc388 commit 1644cb6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/map/utils/parseDMS.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
import { describe, it } from 'vitest';
import { parseDMS } from '../../../src/map/utils/parseDMS';

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

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

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

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

0 comments on commit 1644cb6

Please sign in to comment.