Skip to content

test: Log out envelope item for failing node integration tests #15532

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

Merged
merged 1 commit into from
Feb 27, 2025
Merged
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
12 changes: 9 additions & 3 deletions dev-packages/node-integration-tests/utils/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,17 @@ export function createRunner(...paths: string[]) {
// Catch any error or failed assertions and pass them to done to end the test quickly
try {
if (!expected) {
return;
return;
}

const expectedType = Object.keys(expected)[0];

if (expectedType !== envelopeItemType) {
throw new Error(`Expected envelope item type '${expectedType}' but got '${envelopeItemType}'`);
throw new Error(
`Expected envelope item type '${expectedType}' but got '${envelopeItemType}'. \nItem: ${JSON.stringify(
item,
)}`,
);
}

if ('event' in expected) {
Expand All @@ -322,7 +326,9 @@ export function createRunner(...paths: string[]) {
expectClientReport(item[1] as ClientReport, expected.client_report);
expectCallbackCalled();
} else {
throw new Error(`Unhandled expected envelope item type: ${JSON.stringify(expected)}`);
throw new Error(
`Unhandled expected envelope item type: ${JSON.stringify(expected)}\nItem: ${JSON.stringify(item)}`,
);
}
} catch (e) {
complete(e as Error);
Expand Down
Loading