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:
Chris Raible 2023-04-07 19:03:22 -07:00 committed by GitHub
parent 04e6b9763c
commit 71aca468b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);