mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-14 21:35:38 +02:00
update deps (MisskeyIO#889)
- メンテナンスされないredis-lockを自前実装に変更 - 既にロックされている場合のリトライ間隔を調整
This commit is contained in:
committed by
kakkokari-gtyih
parent
46edd40409
commit
90e2dfef4e
@@ -9,6 +9,7 @@ import * as assert from 'assert';
|
||||
import { jest } from '@jest/globals';
|
||||
import * as lolex from '@sinonjs/fake-timers';
|
||||
import { DataSource } from 'typeorm';
|
||||
import * as Redis from 'ioredis';
|
||||
import TestChart from '@/core/chart/charts/test.js';
|
||||
import TestGroupedChart from '@/core/chart/charts/test-grouped.js';
|
||||
import TestUniqueChart from '@/core/chart/charts/test-unique.js';
|
||||
@@ -18,16 +19,16 @@ import { entity as TestGroupedChartEntity } from '@/core/chart/charts/entities/t
|
||||
import { entity as TestUniqueChartEntity } from '@/core/chart/charts/entities/test-unique.js';
|
||||
import { entity as TestIntersectionChartEntity } from '@/core/chart/charts/entities/test-intersection.js';
|
||||
import { loadConfig } from '@/config.js';
|
||||
import type { AppLockService } from '@/core/AppLockService.js';
|
||||
import Logger from '@/logger.js';
|
||||
|
||||
describe('Chart', () => {
|
||||
const config = loadConfig();
|
||||
const appLockService = {
|
||||
getChartInsertLock: () => () => Promise.resolve(() => {}),
|
||||
} as unknown as jest.Mocked<AppLockService>;
|
||||
|
||||
let db: DataSource | undefined;
|
||||
let redisForTimelines = {
|
||||
set: () => Promise.resolve('OK'),
|
||||
get: () => Promise.resolve(null),
|
||||
} as unknown as jest.Mocked<Redis.Redis>;
|
||||
|
||||
let testChart: TestChart;
|
||||
let testGroupedChart: TestGroupedChart;
|
||||
@@ -64,10 +65,10 @@ describe('Chart', () => {
|
||||
await db.initialize();
|
||||
|
||||
const logger = new Logger('chart'); // TODO: モックにする
|
||||
testChart = new TestChart(db, appLockService, logger);
|
||||
testGroupedChart = new TestGroupedChart(db, appLockService, logger);
|
||||
testUniqueChart = new TestUniqueChart(db, appLockService, logger);
|
||||
testIntersectionChart = new TestIntersectionChart(db, appLockService, logger);
|
||||
testChart = new TestChart(db, redisForTimelines, logger);
|
||||
testGroupedChart = new TestGroupedChart(db, redisForTimelines, logger);
|
||||
testUniqueChart = new TestUniqueChart(db, redisForTimelines, logger);
|
||||
testIntersectionChart = new TestIntersectionChart(db, redisForTimelines, logger);
|
||||
|
||||
clock = lolex.install({
|
||||
now: new Date(Date.UTC(2000, 0, 1, 0, 0, 0)),
|
||||
|
||||
Reference in New Issue
Block a user