Skip to content

Commit 1644cb6

Browse files
committed
test: add parseDMS
1 parent 99dc388 commit 1644cb6

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/map/utils/parseDMS.test.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
import { describe, it } from 'vitest';
2+
import { parseDMS } from '../../../src/map/utils/parseDMS';
23

3-
describe.concurrent('', () => {});
4+
describe.concurrent('Parse Degrees Minutes Seconds Direction', () => {
5+
it('Example', ({ expect }) => {
6+
const res = parseDMS(`11°11'11.1"N 11°11'11.1"E`);
7+
8+
expect(res).toStrictEqual([11.186416666666666, 11.186416666666666]);
9+
});
10+
11+
it('Negative Example', ({ expect }) => {
12+
const res = parseDMS(`11°11'11.1"S 11°11'11.1"W`);
13+
14+
expect(res).toStrictEqual([-11.186416666666666, -11.186416666666666]);
15+
});
16+
});

0 commit comments

Comments
 (0)