fix: use variadic array type for MockDate constructor args

TS2367: fixed-length tuple made args.length === 0 unreachable.
This commit is contained in:
sudacode committed 2026-03-28 10:21:47 -07:00
1 parent efcacded66
commit b92f253458
1 file changed
+2 -4
@@ -85,14 +85,12 @@ function withMockDate<T>(fixedDate: Date, run: (realDate: typeof Date) => T): T
const realDate = Date;
const fixedDateMs = fixedDate.getTime();
type MockDateArgs = [any, any, any, any, any, any, any];
class MockDate extends Date {
constructor(...args: MockDateArgs) {
constructor(...args: any[]) {
if (args.length === 0) {
super(fixedDateMs);
} else {
super(...args);
super(args[0]);
}
}