-
I am assuming Sentry to monitor our tests. My tests fail with a custom error object that describes message and location of the error, e.g. {
message: 'Something failed',
file: '/Users/gajus/Documents/dev/contra/contra-web-app/tests/e2e/foo.spec.ts',
line: 6,
column: 42
}, I can capture this event with Is there a utility that would help me to generate Sentry compatible stack frame based on this information? Effectively, given file, line and column, I need something like: {
filename: '/Users/gajus/Documents/dev/contra/contra-web-app/node_modules/@playwright/test/lib/worker.js',
module: '@playwright.test.lib:worker',
function: 'process.<anonymous>',
lineno: 88,
colno: 5,
in_app: false,
pre_context: [
" if (message.method === 'stop') {",
' await gracefullyCloseAndExit();',
' return;',
' }',
'',
" if (message.method === 'run') {",
' const runPayload = message.params;'
],
context_line: ' await workerRunner.runTestGroup(runPayload);',
post_context: [
' }',
'});',
'',
'async function gracefullyCloseAndExit() {',
' if (closed) return;',
' closed = true; // Force exit after 30 seconds.',
''
]
}, |
Beta Was this translation helpful? Give feedback.
Answered by
gajus
Oct 12, 2022
Replies: 1 comment 2 replies
-
Found |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
AbhiPrasad
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found
addContextToFrame
🥳