mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-30 06:12:06 -07:00
fix: remove strict spread usage in Date mocks
This commit is contained in:
@@ -793,12 +793,9 @@ 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: any[]) {
|
constructor(...args: ConstructorParameters<typeof Date>) {
|
||||||
if (args.length === 0) {
|
const resolvedArgs = args.length === 0 ? [new RealDate(2026, 2, 1, 12, 0, 0).getTime()] : args;
|
||||||
super(new RealDate(2026, 2, 1, 12, 0, 0).getTime());
|
return Reflect.construct(RealDate, resolvedArgs, new.target) as this;
|
||||||
} else {
|
|
||||||
super(...args);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static override now(): number {
|
static override now(): number {
|
||||||
@@ -1069,12 +1066,9 @@ 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: any[]) {
|
constructor(...args: ConstructorParameters<typeof Date>) {
|
||||||
if (args.length === 0) {
|
const resolvedArgs = args.length === 0 ? [new RealDate(2026, 2, 15, 12, 0, 0).getTime()] : args;
|
||||||
super(new RealDate(2026, 2, 15, 12, 0, 0).getTime());
|
return Reflect.construct(RealDate, resolvedArgs, new.target) as this;
|
||||||
} else {
|
|
||||||
super(...args);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static override now(): number {
|
static override now(): number {
|
||||||
|
|||||||
Reference in New Issue
Block a user