Skip to content
Prev Previous commit
Round the currentTime to 1 decimal place
  • Loading branch information
Juice10 committed Jan 9, 2023
commit 0ce9db9b7c6e24f8384564bd4bde3af970a8db98
8 changes: 8 additions & 0 deletions packages/rrweb/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@ function stringifySnapshots(snapshots: eventWithTime[]): string {
}
}
});
} else if (
s.type === EventType.IncrementalSnapshot &&
s.data.source === IncrementalSource.MediaInteraction
) {
// round the currentTime to 1 decimal place
if (s.data.currentTime) {
s.data.currentTime = Math.round(s.data.currentTime * 10) / 10;
}
}
delete (s as Optional<eventWithTime, 'timestamp'>).timestamp;
return s as event;
Expand Down