File tree Expand file tree Collapse file tree
dev-packages/node-integration-tests/suites
contextLines/filename-with-spaces
public-api/captureException Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ describe('ContextLines integration in ESM', () => {
1818 stacktrace : {
1919 frames : expect . arrayContaining ( [
2020 {
21- filename : 'app:///suites/contextLines/filename-with-spaces/scenario with space.mjs' ,
21+ filename : '/suites/contextLines/filename-with-spaces/scenario with space.mjs' ,
22+ abs_path : expect . stringContaining ( '/dev-packages/node-integration-tests/suites/contextLines/filename-with-spaces/scenario with space.mjs' ) ,
2223 context_line : "Sentry.captureException(new Error('Test Error'));" ,
2324 pre_context : [ "import * as Sentry from '@sentry/node';" , '' ] ,
2425 post_context : [ '' , '// some more post context' ] ,
@@ -54,7 +55,8 @@ describe('ContextLines integration in CJS', () => {
5455 stacktrace : {
5556 frames : expect . arrayContaining ( [
5657 {
57- filename : 'app:///suites/contextLines/filename-with-spaces/scenario with space.cjs' ,
58+ filename : '/suites/contextLines/filename-with-spaces/scenario with space.cjs' ,
59+ abs_path : expect . stringContaining ( '/dev-packages/node-integration-tests/suites/contextLines/filename-with-spaces/scenario with space.cjs' ) ,
5860 context_line : "Sentry.captureException(new Error('Test Error'));" ,
5961 pre_context : [
6062 '' ,
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ test('should work inside catch block', async () => {
2121 stacktrace : {
2222 frames : expect . arrayContaining ( [
2323 expect . objectContaining ( {
24- filename : 'app:///suites/public-api/captureException/catched-error/scenario.ts' ,
24+ filename : '/suites/public-api/captureException/catched-error/scenario.ts' ,
25+ abs_path : expect . stringContaining ( '/dev-packages/node-integration-tests/suites/public-api/captureException/catched-error/scenario.ts' ) ,
2526 context_line : " throw new Error('catched_error');" ,
2627 pre_context : [
2728 'Sentry.init({' ,
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ test('should capture a simple error with message', async () => {
2121 stacktrace : {
2222 frames : expect . arrayContaining ( [
2323 expect . objectContaining ( {
24- filename : 'app:///suites/public-api/captureException/simple-error/scenario.ts' ,
24+ filename : '/suites/public-api/captureException/simple-error/scenario.ts' ,
25+ abs_path : expect . stringContaining ( '/dev-packages/node-integration-tests/suites/public-api/captureException/simple-error/scenario.ts' ) ,
2526 } ) ,
2627 ] ) ,
2728 } ,
Original file line number Diff line number Diff line change @@ -137,13 +137,15 @@ export function generateIteratee({
137137 }
138138 } else {
139139 if ( isWindowsFrame || startsWithSlash ) {
140+ const abs_path = frame . filename ;
140141 const filename = isWindowsFrame
141- ? frame . filename
142+ ? abs_path
142143 . replace ( / ^ [ a - z A - Z ] : / , '' ) // remove Windows-style prefix
143144 . replace ( / \\ / g, '/' ) // replace all `\\` instances with `/`
144- : frame . filename ;
145+ : abs_path ;
145146 const base = root ? relative ( root , filename ) : basename ( filename ) ;
146147 frame . filename = `${ prefix } ${ base } ` ;
148+ frame . abs_path = abs_path ;
147149 }
148150 }
149151
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ export function getDefaultIntegrationsWithoutPerformance(): Integration[] {
7373 // This has to run after the other integrations, because it rewrites the frames
7474 rewriteFramesIntegration ( {
7575 root : process . cwd ( ) ,
76+ prefix : '' ,
7677 } ) ,
7778 ...getCjsOnlyIntegrations ( ) ,
7879 ] ;
You can’t perform that action at this time.
0 commit comments