Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,14 @@ export function defineComponentFixture(options: ComponentFixtureOptions): Themed
// during dispose to drain async cleanup work (e.g. `Promise.race`
// guards behind `timeout(1000)` that hold references until they
// settle) before the leak tracker checks for undisposed objects.
const clock = new VirtualClock(Date.now());
//
// Seed the clock with a fixed wall-clock time so any code under
// test that reads `Date.now()` / `new Date()` produces the same
// values run after run. Real time would otherwise leak in
// through this seed and make screenshots that include
// time-derived labels (e.g. "1 hour ago", "Today") drift
// across days, hour boundaries, and DST changes.
const clock = new VirtualClock(new Date('2026-05-14T12:00:00Z').getTime());
const p = new VirtualTimeProcessor(
clock,
drainMicrotasksEmbedding(realTimeApi),
Expand Down
Loading