Skip to content

Commit 2101a2c

Browse files
antonisclaude
andcommitted
fix(e2e): Address PR review feedback
- Use nullish coalescing for httpSpans length check to avoid TypeError when spans is undefined - Document maestro retry envelope contamination limitation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 19770a2 commit 2101a2c

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

samples/react-native/e2e/tests/captureSpaceflightNewsScreenTransaction/captureSpaceflightNewsScreenTransaction.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,6 @@ describe('Capture Spaceflight News Screen Transaction', () => {
143143
const httpSpans = spans?.filter(
144144
span => span.data?.['sentry.op'] === 'http.client',
145145
);
146-
expect(httpSpans!.length).toBeGreaterThanOrEqual(1);
146+
expect(httpSpans?.length ?? 0).toBeGreaterThanOrEqual(1);
147147
});
148148
});

samples/react-native/e2e/utils/maestro.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ const runMaestro = (test: string): Promise<void> => {
2525
/**
2626
* Run a Maestro test with retries to handle transient app crashes on slow CI VMs.
2727
*
28+
* Note: Retries happen at the Maestro flow level. If a failed attempt sends partial
29+
* envelopes to the mock server before crashing, they will accumulate across retries.
30+
* In practice, crashes occur on app launch before any SDK transactions are sent,
31+
* so this does not cause issues with test assertions.
32+
*
2833
* @param test - The path to the Maestro test file relative to the `e2e` directory.
2934
* @returns A promise that resolves when the test passes.
3035
*/

0 commit comments

Comments
 (0)