feat: add TypeScript typecheck\

This commit is contained in:
2026-03-23 09:25:33 +05:30
parent 36c6700437
commit ff065300ad
3 changed files with 11 additions and 14 deletions
+4 -12
View File
@@ -149,14 +149,13 @@ describe("closeMultiModel", () => {
// Freeze timestamp for deterministic tag name
const fixedDate = new Date("2023-01-01T00:00:00.000Z");
const OriginalDate = Date;
// @ts-expect-error
global.Date = class extends OriginalDate {
constructor() {
super();
// biome-ignore lint/correctness/noConstructorReturn: time-mocking required
return fixedDate;
}
toISOString() {
override toISOString() {
return "2023-01-01T00:00:00.000Z";
}
} as any;
@@ -167,7 +166,6 @@ describe("closeMultiModel", () => {
force: true,
});
// Restore Date
// @ts-expect-error
global.Date = OriginalDate;
expect(result.success).toBe(true);
@@ -241,14 +239,13 @@ describe("closeMultiModel", () => {
// Freeze timestamp for deterministic tag name
const fixedDate = new Date("2023-01-01T00:00:00.000Z");
const OriginalDate = Date;
// @ts-expect-error
global.Date = class extends OriginalDate {
constructor() {
super();
// biome-ignore lint/correctness/noConstructorReturn: time-mocking required
return fixedDate;
}
toISOString() {
override toISOString() {
return "2023-01-01T00:00:00.000Z";
}
} as any;
@@ -260,7 +257,6 @@ describe("closeMultiModel", () => {
});
// Restore Date after invocation
// @ts-expect-error
global.Date = OriginalDate;
// Verify result indicates successful cleanup
@@ -308,14 +304,13 @@ describe("closeMultiModel", () => {
// Tag command will fail
const fixedDate = new Date("2023-01-01T00:00:00.000Z");
const OriginalDate = Date;
// @ts-expect-error
global.Date = class extends OriginalDate {
constructor() {
super();
// biome-ignore lint/correctness/noConstructorReturn: time-mocking required
return fixedDate;
}
toISOString() {
override toISOString() {
return "2023-01-01T00:00:00.000Z";
}
} as any;
@@ -332,7 +327,6 @@ describe("closeMultiModel", () => {
force: true,
});
// Restore Date
// @ts-expect-error
global.Date = OriginalDate;
expect(result.success).toBe(true);
@@ -374,14 +368,13 @@ describe("closeMultiModel", () => {
// Freeze timestamp for deterministic tag name
const fixedDate = new Date("2023-01-01T00:00:00.000Z");
const OriginalDate = Date;
// @ts-expect-error
global.Date = class extends OriginalDate {
constructor() {
super();
// biome-ignore lint/correctness/noConstructorReturn: time-mocking required
return fixedDate;
}
toISOString() {
override toISOString() {
return "2023-01-01T00:00:00.000Z";
}
} as any;
@@ -392,7 +385,6 @@ describe("closeMultiModel", () => {
force: true,
});
// Restore Date
// @ts-expect-error
global.Date = OriginalDate;
expect(result.success).toBe(true);