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:
parent
0cc3164b25
commit
db589b1ad4
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user