Fixed flaky test: Can generate a mentions report (#16592)
refs TryGhost/Team#2844 - assertion was comparing a constant `now` with a `new Date()` that was made on the next line — by passing now in as the end date to `getMentionReport`, the end date should always equal the constant - intent of the test is just to make sure a mentions report can generate, so we can just use the variable now instead of creating new Date() objects
This commit is contained in:
parent
04e6b9763c
commit
71aca468b3
@ -45,7 +45,7 @@ describe('MentionsAPI', function () {
|
||||
});
|
||||
|
||||
it('Can generate a mentions report', async function () {
|
||||
this.retries(1);
|
||||
// this.retries(1);
|
||||
const repository = new InMemoryMentionRepository();
|
||||
const api = new MentionsAPI({
|
||||
repository,
|
||||
@ -64,7 +64,7 @@ describe('MentionsAPI', function () {
|
||||
|
||||
const now = new Date();
|
||||
|
||||
const report = await api.getMentionReport(new Date(0), new Date());
|
||||
const report = await api.getMentionReport(new Date(0), now);
|
||||
|
||||
assert.deepEqual(report.startDate, new Date(0));
|
||||
assert.deepEqual(report.endDate, now);
|
||||
|
Loading…
Reference in New Issue
Block a user