fix test
This commit is contained in:
parent
28fdf1b9a6
commit
a685336a8b
|
@ -20,7 +20,6 @@ import type { MiUser } from '@/models/User.js';
|
||||||
import type { MiChannel } from '@/models/Channel.js';
|
import type { MiChannel } from '@/models/Channel.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
import { isNotNull } from '@/misc/is-not-null.js';
|
|
||||||
import { DriveFileEntityService } from './DriveFileEntityService.js';
|
import { DriveFileEntityService } from './DriveFileEntityService.js';
|
||||||
import { NoteEntityService } from './NoteEntityService.js';
|
import { NoteEntityService } from './NoteEntityService.js';
|
||||||
|
|
||||||
|
@ -98,7 +97,7 @@ export class ChannelEntityService {
|
||||||
...(
|
...(
|
||||||
opts?.pinnedNotes
|
opts?.pinnedNotes
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
// 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) })
|
: await this.notesRepository.findBy({ id: In(channel.pinnedNoteIds) })
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// noinspection JSUnusedLocalSymbols
|
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
|
||||||
// How to run:
|
// How to run:
|
||||||
|
@ -12,8 +11,8 @@
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
import { entities } from 'misskey-js';
|
import { entities } from 'misskey-js';
|
||||||
import { Redis } from 'ioredis';
|
import { Redis } from 'ioredis';
|
||||||
import { loadConfig } from '@/config.js';
|
|
||||||
import { afterEach, beforeAll } from '@jest/globals';
|
import { afterEach, beforeAll } from '@jest/globals';
|
||||||
|
import { loadConfig } from '@/config.js';
|
||||||
import {
|
import {
|
||||||
api,
|
api,
|
||||||
initTestDb,
|
initTestDb,
|
||||||
|
@ -91,6 +90,7 @@ describe('Timelines', () => {
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
redisForTimelines = new Redis(loadConfig().redisForTimelines);
|
redisForTimelines = new Redis(loadConfig().redisForTimelines);
|
||||||
|
root = await signup({ username: 'root' });
|
||||||
|
|
||||||
// FTT無効の状態で見たいときはコメントアウトを外す
|
// FTT無効の状態で見たいときはコメントアウトを外す
|
||||||
await api('admin/update-meta', { enableFanoutTimeline: false }, root);
|
await api('admin/update-meta', { enableFanoutTimeline: false }, root);
|
||||||
|
|
|
@ -6,4 +6,5 @@
|
||||||
module.exports = async () => {
|
module.exports = async () => {
|
||||||
// DBはUTC(っぽい)ので、テスト側も合わせておく
|
// DBはUTC(っぽい)ので、テスト側も合わせておく
|
||||||
process.env.TZ = 'UTC';
|
process.env.TZ = 'UTC';
|
||||||
|
process.env.NODE_ENV = 'test';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue