From a685336a8b2ad81e9e298644b4e2fff938000b81 Mon Sep 17 00:00:00 2001 From: samunohito <46447427+samunohito@users.noreply.github.com> Date: Sun, 30 Jun 2024 22:20:46 +0900 Subject: [PATCH] fix test --- packages/backend/src/core/entities/ChannelEntityService.ts | 3 +-- packages/backend/test/e2e/timelines.ts | 4 ++-- packages/backend/test/jest.setup.unit.cjs | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/core/entities/ChannelEntityService.ts b/packages/backend/src/core/entities/ChannelEntityService.ts index bae3d5c117..1a789bc434 100644 --- a/packages/backend/src/core/entities/ChannelEntityService.ts +++ b/packages/backend/src/core/entities/ChannelEntityService.ts @@ -20,7 +20,6 @@ import type { MiUser } from '@/models/User.js'; import type { MiChannel } from '@/models/Channel.js'; import { bindThis } from '@/decorators.js'; import { IdService } from '@/core/IdService.js'; -import { isNotNull } from '@/misc/is-not-null.js'; import { DriveFileEntityService } from './DriveFileEntityService.js'; import { NoteEntityService } from './NoteEntityService.js'; @@ -98,7 +97,7 @@ export class ChannelEntityService { ...( opts?.pinnedNotes // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - ? channel.pinnedNoteIds.map(it => opts.pinnedNotes!.get(it)).filter(isNotNull) + ? channel.pinnedNoteIds.map(it => opts.pinnedNotes!.get(it)).filter(it => it != null) : await this.notesRepository.findBy({ id: In(channel.pinnedNoteIds) }) ), ); diff --git a/packages/backend/test/e2e/timelines.ts b/packages/backend/test/e2e/timelines.ts index f3db48412d..2afdbb203c 100644 --- a/packages/backend/test/e2e/timelines.ts +++ b/packages/backend/test/e2e/timelines.ts @@ -3,7 +3,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -// noinspection JSUnusedLocalSymbols /* eslint-disable @typescript-eslint/no-explicit-any */ // How to run: @@ -12,8 +11,8 @@ import * as assert from 'assert'; import { entities } from 'misskey-js'; import { Redis } from 'ioredis'; -import { loadConfig } from '@/config.js'; import { afterEach, beforeAll } from '@jest/globals'; +import { loadConfig } from '@/config.js'; import { api, initTestDb, @@ -91,6 +90,7 @@ describe('Timelines', () => { beforeAll(async () => { redisForTimelines = new Redis(loadConfig().redisForTimelines); + root = await signup({ username: 'root' }); // FTT無効の状態で見たいときはコメントアウトを外す await api('admin/update-meta', { enableFanoutTimeline: false }, root); diff --git a/packages/backend/test/jest.setup.unit.cjs b/packages/backend/test/jest.setup.unit.cjs index 896f9e0b9d..dd879c81c8 100644 --- a/packages/backend/test/jest.setup.unit.cjs +++ b/packages/backend/test/jest.setup.unit.cjs @@ -6,4 +6,5 @@ module.exports = async () => { // DBはUTC(っぽい)ので、テスト側も合わせておく process.env.TZ = 'UTC'; + process.env.NODE_ENV = 'test'; };