Skip to content

Commit cdcc615

Browse files
committed
implement Symbol.hasInstance for MockDate
1 parent f073eba commit cdcc615

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/ladle/lib/app/src/mock-date.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ const MockDate = class Date extends RealDate {
5656

5757
return date;
5858
}
59+
60+
static [Symbol.hasInstance](instance: unknown): boolean {
61+
return instance instanceof RealDate;
62+
}
5963
};
6064

6165
MockDate.UTC = RealDate.UTC;

0 commit comments

Comments
 (0)