chore: reduce flakey test due to '[vite] connected' message (#1525)

This commit is contained in:
Justin Halsall
2024-07-05 10:46:00 +02:00
committed by GitHub
parent 68076b724f
commit e0590bbdf1
2 changed files with 13 additions and 3 deletions

View File

@@ -0,0 +1,2 @@
---
---

View File

@@ -110,9 +110,17 @@ export function stringifySnapshots(snapshots: eventWithTime[]): string {
snapshots
.filter((s) => {
if (
s.type === EventType.IncrementalSnapshot &&
(s.data.source === IncrementalSource.MouseMove ||
s.data.source === IncrementalSource.ViewportResize)
// mouse move or viewport resize can happen on accidental user interference
// so we ignore them
(s.type === EventType.IncrementalSnapshot &&
(s.data.source === IncrementalSource.MouseMove ||
s.data.source === IncrementalSource.ViewportResize)) ||
// ignore '[vite] connected' messages from vite
(s.type === EventType.Plugin &&
s.data.plugin === 'rrweb/console@1' &&
(s.data.payload as { payload: string[] })?.payload?.find((msg) =>
msg.includes('[vite] connected'),
))
) {
return false;
}