mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-30 06:12:06 -07:00
fix: resolve CI type failures in boot and immersion query tests
This commit is contained in:
@@ -793,8 +793,12 @@ test('getTrendsDashboard month grouping spans every touched calendar month and k
|
|||||||
const RealDate = Date;
|
const RealDate = Date;
|
||||||
|
|
||||||
class MockDate extends Date {
|
class MockDate extends Date {
|
||||||
constructor(...args: ConstructorParameters<typeof Date>) {
|
constructor(...args: any[]) {
|
||||||
super(...(args.length === 0 ? [new RealDate(2026, 2, 1, 12, 0, 0).getTime()] : args));
|
if (args.length === 0) {
|
||||||
|
super(new RealDate(2026, 2, 1, 12, 0, 0).getTime());
|
||||||
|
} else {
|
||||||
|
super(...args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static override now(): number {
|
static override now(): number {
|
||||||
@@ -1065,8 +1069,12 @@ test('getQueryHints computes weekly new-word cutoff from calendar midnights', ()
|
|||||||
const RealDate = Date;
|
const RealDate = Date;
|
||||||
|
|
||||||
class MockDate extends Date {
|
class MockDate extends Date {
|
||||||
constructor(...args: ConstructorParameters<typeof Date>) {
|
constructor(...args: any[]) {
|
||||||
super(...(args.length === 0 ? [new RealDate(2026, 2, 15, 12, 0, 0).getTime()] : args));
|
if (args.length === 0) {
|
||||||
|
super(new RealDate(2026, 2, 15, 12, 0, 0).getTime());
|
||||||
|
} else {
|
||||||
|
super(...args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static override now(): number {
|
static override now(): number {
|
||||||
|
|||||||
@@ -3,12 +3,33 @@ import test from 'node:test';
|
|||||||
import { createMainBootServices } from './services';
|
import { createMainBootServices } from './services';
|
||||||
|
|
||||||
test('createMainBootServices builds boot-phase service bundle', () => {
|
test('createMainBootServices builds boot-phase service bundle', () => {
|
||||||
|
type MockAppLifecycleApp = {
|
||||||
|
requestSingleInstanceLock: () => boolean;
|
||||||
|
quit: () => void;
|
||||||
|
on: (event: string, listener: (...args: unknown[]) => void) => MockAppLifecycleApp;
|
||||||
|
whenReady: () => Promise<void>;
|
||||||
|
};
|
||||||
|
|
||||||
const calls: string[] = [];
|
const calls: string[] = [];
|
||||||
let setPathValue: string | null = null;
|
let setPathValue: string | null = null;
|
||||||
const appOnCalls: string[] = [];
|
const appOnCalls: string[] = [];
|
||||||
let secondInstanceHandlerRegistered = false;
|
let secondInstanceHandlerRegistered = false;
|
||||||
|
|
||||||
const services = createMainBootServices({
|
const services = createMainBootServices<
|
||||||
|
{ configDir: string },
|
||||||
|
{ targetPath: string },
|
||||||
|
{ targetPath: string },
|
||||||
|
{ targetPath: string },
|
||||||
|
{ kind: string },
|
||||||
|
{ scope: string; warn: () => void; info: () => void; error: () => void },
|
||||||
|
{ registry: boolean },
|
||||||
|
{ getModalWindow: () => null },
|
||||||
|
{ inputState: boolean },
|
||||||
|
{ measurementStore: boolean },
|
||||||
|
{ modalRuntime: boolean },
|
||||||
|
{ mpvSocketPath: string; texthookerPort: number },
|
||||||
|
MockAppLifecycleApp
|
||||||
|
>({
|
||||||
platform: 'linux',
|
platform: 'linux',
|
||||||
argv: ['node', 'main.ts'],
|
argv: ['node', 'main.ts'],
|
||||||
appDataDir: undefined,
|
appDataDir: undefined,
|
||||||
|
|||||||
Reference in New Issue
Block a user