From 029f67b7e545188351504afbef7e4ac7c5fadb94 Mon Sep 17 00:00:00 2001 From: dakkar Date: Tue, 18 Feb 2025 20:47:48 +0000 Subject: [PATCH] fix time zone for CustomEmojiService test otherwise, the timestamps that the test uses for queries are interpreted as UTC (because they have a TZ in the string), but the truncated date is interpreted in the session timezone, which defaults to the server timezone, which can be anything thanks to @fEmber for noticing --- packages/backend/test/unit/CustomEmojiService.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend/test/unit/CustomEmojiService.ts b/packages/backend/test/unit/CustomEmojiService.ts index ffd96356e0..8c3dac69e8 100644 --- a/packages/backend/test/unit/CustomEmojiService.ts +++ b/packages/backend/test/unit/CustomEmojiService.ts @@ -17,6 +17,7 @@ import { EmojisRepository } from '@/models/_.js'; import { MiEmoji } from '@/models/Emoji.js'; import { CoreModule } from '@/core/CoreModule.js'; import { DriveService } from '@/core//DriveService.js'; +import { DataSource } from 'typeorm'; describe('CustomEmojiService', () => { let app: TestingModule; @@ -48,6 +49,7 @@ describe('CustomEmojiService', () => { service = app.get(CustomEmojiService); emojisRepository = app.get(DI.emojisRepository); idService = app.get(IdService); + await app.get(DI.db).query("set session time zone 'UTC'"); }); describe('fetchEmojis', () => {