From 103790cccf610e244cb54d29fb9356c30e453356 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 16 Nov 2022 14:24:17 +0100 Subject: [PATCH] use jest.fn() for void function, correct timezone offset --- backend/src/graphql/resolver/util/creations.test.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/src/graphql/resolver/util/creations.test.ts b/backend/src/graphql/resolver/util/creations.test.ts index 7ab71c367..8d747e989 100644 --- a/backend/src/graphql/resolver/util/creations.test.ts +++ b/backend/src/graphql/resolver/util/creations.test.ts @@ -171,8 +171,7 @@ describe('util/creation', () => { beforeAll(() => { jest.useFakeTimers() - /* eslint-disable-next-line @typescript-eslint/no-empty-function */ - setTimeout(() => {}, targetDate.getTime() - now.getTime()) + setTimeout(jest.fn(), targetDate.getTime() - now.getTime()) jest.runAllTimers() }) @@ -221,8 +220,7 @@ describe('util/creation', () => { nextMonthTargetDate.setTime(targetDate.getTime() + 2 * 60 * 60 * 1000) beforeAll(() => { - /* eslint-disable-next-line @typescript-eslint/no-empty-function */ - setTimeout(() => {}, 2 * 60 * 60 * 1000) + setTimeout(jest.fn(), 2 * 60 * 60 * 1000) jest.runAllTimers() }) @@ -234,7 +232,7 @@ describe('util/creation', () => { describe('call getUserCreation with UTC', () => { it('returns the expected open contributions', async () => { - await expect(getUserCreation(user.id, -540, true)).resolves.toEqual([ + await expect(getUserCreation(user.id, 0, true)).resolves.toEqual([ expect.decimalEqual(340), expect.decimalEqual(350), expect.decimalEqual(1000),