File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -6,27 +6,34 @@ import { extractAllTracebackInfo } from "../traceback";
66describe ( "traceback" , ( ) => {
77 test ( "extracts cell-link" , ( ) => {
88 const errors = extractAllTracebackInfo ( Tracebacks . raw ) ;
9- expect ( errors ) . toMatchInlineSnapshot ( `
9+ expect ( errors [ 0 ] . isCell ) . toBe ( false ) ;
10+ expect ( errors [ 0 ] . src . endsWith ( "marimo/_runtime/executor.py" ) ) . toBe ( true ) ;
11+ expect ( errors . slice ( 1 ) ) . toMatchInlineSnapshot ( `
1012 [
1113 {
12- "cellId ": "Hbol" ,
14+ "isCell ": true ,
1315 "lineNumber": 4,
16+ "src": "Hbol",
1417 },
1518 {
16- "cellId ": "Hbol" ,
19+ "isCell ": true ,
1720 "lineNumber": 2,
21+ "src": "Hbol",
1822 },
1923 ]
2024 ` ) ;
2125 } ) ;
2226
2327 test ( "extracts cell-link from assertion" , ( ) => {
2428 const info = extractAllTracebackInfo ( Tracebacks . assertion ) ;
25- expect ( info ) . toMatchInlineSnapshot ( `
29+ expect ( info [ 0 ] . isCell ) . toBe ( false ) ;
30+ expect ( info [ 0 ] . src . endsWith ( "marimo/_runtime/executor.py" ) ) . toBe ( true ) ;
31+ expect ( info . slice ( 1 ) ) . toMatchInlineSnapshot ( `
2632 [
2733 {
28- "cellId ": "Hbol" ,
34+ "isCell ": true ,
2935 "lineNumber": 1,
36+ "src": "Hbol",
3037 },
3138 ]
3239 ` ) ;
Original file line number Diff line number Diff line change @@ -112,11 +112,8 @@ export function extractAllTracebackInfo(traceback: string): TracebackInfo[] {
112112 replace : ( domNode ) => {
113113 const info = getTracebackInfo ( domNode ) ;
114114 if ( info ) {
115- infos . push ( {
116- cellId : info . cellId ,
117- lineNumber : info . lineNumber ,
118- } ) ;
119- return `${ info . cellId } :${ info . lineNumber } ` ;
115+ infos . push ( info ) ;
116+ return `${ info . src } :${ info . lineNumber } ` ;
120117 }
121118 } ,
122119 } ) ;
You can’t perform that action at this time.
0 commit comments