diff --git a/.changeset/sharp-chicken-tickle.md b/.changeset/sharp-chicken-tickle.md new file mode 100644 index 00000000..67d2dbe6 --- /dev/null +++ b/.changeset/sharp-chicken-tickle.md @@ -0,0 +1,6 @@ +--- +"@replayio/cypress": major +"@replayio/playwright": major +--- + +Remove deprecated `filter` function from test config diff --git a/packages/test-utils/src/reporter.ts b/packages/test-utils/src/reporter.ts index 36d44220..95a6cf41 100644 --- a/packages/test-utils/src/reporter.ts +++ b/packages/test-utils/src/reporter.ts @@ -224,7 +224,6 @@ export default class ReplayReporter< private _apiKey?: string; private _pendingWork: Promise[] = []; private _upload = false; - private _filter?: (r: RecordingEntry) => boolean; private _minimizeUploads = false; private _uploadableResults: Map> = new Map(); private _testRunShardIdPromise: Promise | null = null; @@ -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 @@ -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) { @@ -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)) ); } diff --git a/packages/test-utils/src/types.ts b/packages/test-utils/src/types.ts index f6a6eddd..fb0f3ba3 100644 --- a/packages/test-utils/src/types.ts +++ b/packages/test-utils/src/types.ts @@ -45,11 +45,9 @@ export type UploadOptions = { export interface ReplayReporterConfig< TRecordingMetadata extends UnstructuredMetadata = UnstructuredMetadata > { - runTitle?: string; - metadata?: Record | 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) => boolean; }