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
This commit is contained in:
dakkar 2025-02-18 20:47:48 +00:00
parent c28b27b57f
commit 029f67b7e5

View file

@ -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>(CustomEmojiService);
emojisRepository = app.get<EmojisRepository>(DI.emojisRepository);
idService = app.get<IdService>(IdService);
await app.get<DataSource>(DI.db).query("set session time zone 'UTC'");
});
describe('fetchEmojis', () => {