Skip to content

Commit ced46cb

Browse files
author
Marvel Mathew
committed
Add integration test for invalid relative time
1 parent f28f3fd commit ced46cb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

spec/ParseQuery.spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3147,4 +3147,17 @@ describe('Parse.Query testing', () => {
31473147
})
31483148
.then(done, done.fail);
31493149
});
3150+
3151+
it('should error on invalid relative time', function(done) {
3152+
const obj1 = new Parse.Object('MyCustomObject', {
3153+
name: 'obj1',
3154+
ttl: new Date(Date.now() + 2 * 24 * 60 * 60 * 1000), // 2 days from now
3155+
});
3156+
3157+
const q = new Parse.Query('MyCustomObject');
3158+
q.greaterThan('ttl', { $relativeTime: '-12 bananas ago' });
3159+
return obj1.save({ useMasterKey: true })
3160+
.then(() => q.find({ useMasterKey: true }))
3161+
.then(done.fail, done);
3162+
});
31503163
});

0 commit comments

Comments
 (0)