Skip to content

Commit 539d648

Browse files
authored
fix(node): Improve logging in express scope tag match test (#5977)
This adds logging of the received and expected values when the tags in the express scope separation test don't match, for easier debugging.
1 parent 0596b6f commit 539d648

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/node/test/manual/express-scope-separation/start.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ global.console.error = () => null;
1111
function assertTags(actual, expected) {
1212
if (JSON.stringify(actual) !== JSON.stringify(expected)) {
1313
console.log(colorize('FAILED: Scope contains incorrect tags\n', 'red'));
14+
console.log(colorize(`Got: ${JSON.stringify(actual)}\n`, 'red'));
15+
console.log(colorize(`Expected: ${JSON.stringify(expected)}\n`, 'red'));
1416
process.exit(1);
1517
}
1618
}

packages/node/test/manual/webpack-domain/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,16 @@ Sentry.init({
2626
if (event.message === 'inside') {
2727
if (event.tags.a !== 'x' && event.tags.b !== 'c') {
2828
console.log(colorize('FAILED: Scope contains incorrect tags\n', 'red'));
29+
console.log(colorize(`Got: ${JSON.stringify(event.tags)}\n`, 'red'));
30+
console.log(colorize(`Expected: Object including { a: 'x', b: 'c' }\n`, 'red'));
2931
process.exit(1);
3032
}
3133
}
3234
if (event.message === 'outside') {
3335
if (event.tags.a !== 'b') {
3436
console.log(colorize('FAILED: Scope contains incorrect tags\n', 'red'));
37+
console.log(colorize(`Got: ${JSON.stringify(event.tags)}\n`, 'red'));
38+
console.log(colorize(`Expected: Object including { a: 'b' }\n`, 'red'));
3539
process.exit(1);
3640
}
3741
}

0 commit comments

Comments
 (0)