We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba0804c commit 80aa3f0Copy full SHA for 80aa3f0
packages/shell-bson-parser/src/index.spec.ts
@@ -451,6 +451,14 @@ describe('@mongodb-js/shell-bson-parser', function () {
451
452
const actual = parse(input, options);
453
const expectedDate = new (Date as any)(...args) as Date;
454
+
455
+ // Sometimes we'll get a millisecond difference between instantiating the dates, so let's correct for that
456
+ const millisecondsDiff =
457
+ actual.getMilliseconds - expectedDate.getMilliseconds();
458
+ expect(Math.abs(millisecondsDiff)).to.be.lessThan(2);
459
460
+ expectedDate.setMilliseconds(actual.getMilliseconds);
461
462
expect(actual).to.deep.equal({
463
getDate: expectedDate.getDate(),
464
getDay: expectedDate.getDay(),
0 commit comments