Skip to content

Commit

Permalink
chore: reduce flakey test due to '[vite] connected' message (rrweb-io…
Browse files Browse the repository at this point in the history
  • Loading branch information
Juice10 authored and jxiwang committed Oct 22, 2024
1 parent 1dba10a commit c63c427
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 @@ -111,9 +111,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 c63c427

Please sign in to comment.