Skip to content

Commit 9a78f0c

Browse files
committed
Add test for unknown units
1 parent baebe56 commit 9a78f0c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

packages/neaps/test/index.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,17 @@ describe('getWaterLevelAtTime', () => {
101101
expect(prediction.units).toBe('feet')
102102
expect(prediction.level).toBeCloseTo(-1.44, 2)
103103
})
104+
105+
test('with unknown units', () => {
106+
expect(() =>
107+
getWaterLevelAtTime({
108+
lat: 26.772,
109+
lon: -80.05,
110+
time: new Date('2025-12-19T00:30:00-05:00'),
111+
units: 'fathoms' as any
112+
})
113+
).toThrow('Unsupported units: fathoms')
114+
})
104115
})
105116

106117
describe('for a specific station', () => {

0 commit comments

Comments
 (0)