Skip to content

Commit

Permalink
Merge d7e0e9f into ca8e62e
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn authored Jul 5, 2024
2 parents ca8e62e + d7e0e9f commit 4d1fc15
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
6 changes: 6 additions & 0 deletions .changeset/sharp-chicken-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@replayio/cypress": major
"@replayio/playwright": major
---

Remove deprecated `filter` function from test config
10 changes: 1 addition & 9 deletions packages/test-utils/src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ export default class ReplayReporter<
private _apiKey?: string;
private _pendingWork: Promise<PendingWork | undefined>[] = [];
private _upload = false;
private _filter?: (r: RecordingEntry<TRecordingMetadata>) => boolean;
private _minimizeUploads = false;
private _uploadableResults: Map<string, UploadableTestResult<TRecordingMetadata>> = new Map();
private _testRunShardIdPromise: Promise<TestRunPendingWork> | null = null;
Expand Down Expand Up @@ -355,8 +354,6 @@ export default class ReplayReporter<
config.runTitle ||
getFallbackRunTitle();

this._filter = config.filter;

// RECORD_REPLAY_METADATA is our "standard" metadata environment variable.
// We suppress it for the browser process so we can use
// RECORD_REPLAY_METADATA_FILE but can still use the metadata here which
Expand Down Expand Up @@ -425,14 +422,12 @@ export default class ReplayReporter<
baseMetadata: this._baseMetadata,
upload: this._upload,
hasApiKey: !!this._apiKey,
hasFilter: !!this._filter,
});

mixpanelAPI.trackEvent("test-suite.begin", {
baseId: this._baseId,
runTitle: this._runTitle,
upload: this._upload,
hasFilter: !!this._filter,
});

if (!this._apiKey) {
Expand Down Expand Up @@ -1092,10 +1087,7 @@ export default class ReplayReporter<
}

this._pendingWork.push(
...toUpload
.flatMap(result => result.recordings)
.filter(r => (this._filter ? this._filter(r) : true))
.map(r => this._uploadRecording(r))
...toUpload.flatMap(result => result.recordings).map(r => this._uploadRecording(r))
);
}

Expand Down
8 changes: 3 additions & 5 deletions packages/test-utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ export type UploadOptions = {
export interface ReplayReporterConfig<
TRecordingMetadata extends UnstructuredMetadata = UnstructuredMetadata
> {
runTitle?: string;
metadata?: Record<string, any> | string;
apiKey?: string;
metadata?: TRecordingMetadata;
metadataKey?: string;
runTitle?: string;
upload?: UploadOptions | boolean;
apiKey?: string;
/** @deprecated Use `upload.minimizeUploads` and `upload.statusThreshold` instead */
filter?: (r: RecordingEntry<TRecordingMetadata>) => boolean;
}

0 comments on commit 4d1fc15

Please sign in to comment.