Skip to content

Commit dc61f91

Browse files
author
Marvel Mathew
committed
Add test for erroring on floating point units
1 parent af0f831 commit dc61f91

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spec/MongoTransform.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,13 @@ describe('relativeTimeToDate', () => {
398398
});
399399
});
400400

401+
it('should error on floating point numbers', () => {
402+
expect(transform.relativeTimeToDate('in 12.3 hours')).toEqual({
403+
status: 'error',
404+
info: "'12.3' is not an integer.",
405+
});
406+
});
407+
401408
it('should error if numbers are invalid', () => {
402409
expect(transform.relativeTimeToDate('12 hours 123a minute ago')).toEqual({
403410
status: 'error',

0 commit comments

Comments
 (0)