Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
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
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
Loading