Skip to content

Commit

Permalink
test: fix timing in test case
Browse files Browse the repository at this point in the history
  • Loading branch information
JustSamuel committed Aug 23, 2024
1 parent 88912d4 commit ecd1b92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/unit/service/report-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,9 @@ describe('ReportService', () => {

it('should return the total expenditure of a user with mixed transactions before and after the tillDate', async () => {
await inUserContext((await UserFactory()).clone(2), async (debtor: User, creditor: User) => {
const tillDate = new Date(new Date().getTime() + 1500); // Set tillDate to 1.5 seconds after current time
await createTransactions(debtor.id, creditor.id, 2, 2000); // Transactions 2 seconds in the future (after tillDate)
const transactions = await createTransactions(debtor.id, creditor.id, 3, 1000); // Transactions 1 second in the future (before tillDate)
const transactions = await createTransactions(debtor.id, creditor.id, 3);
const tillDate = new Date();
await createTransactions(debtor.id, creditor.id, 2);
await checkTransactionsBuyerReport(transactions.transactions, {
fromDate: new Date(2000, 0, 0),
tillDate,
Expand Down

0 comments on commit ecd1b92

Please sign in to comment.