Skip to content

Commit

Permalink
chore: reduce flakey test due to '[vite] connected' message (#1525)
Browse files Browse the repository at this point in the history
  • Loading branch information
Juice10 authored Jul 5, 2024
1 parent 68076b7 commit e0590bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .changeset/two-boats-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
14 changes: 11 additions & 3 deletions packages/rrweb/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e0590bb

Please sign in to comment.