Fixed random unit test failure for revue importer

refs https://github.com/TryGhost/Ghost/actions/runs/4477418718/jobs/7868921949

This test used the current time, and this resulted in a `AssertionError [ERR_ASSERTION]: '2023-03-21T09:28:29.837Z' == '2023-03-21T09:28:29.838Z'` in rare situations.
This commit is contained in:
Simon Backx 2023-03-21 10:46:13 +01:00
parent 0cc3164b25
commit db589b1ad4

View File

@ -162,9 +162,12 @@ describe('Revue Importer', function () {
});
it('can get date for draft post', function () {
const clock = sinon.useFakeTimers(); // required because assertion could be 1ms off
const result = JSONToHTML.getPostDate({});
const expected = new Date().toISOString();
clock.restore();
assert.equal(result, new Date().toISOString());
assert.equal(result, expected);
});
});