File tree Expand file tree Collapse file tree 1 file changed +17
-12
lines changed
packages/enzyme-test-suite/test/shared/lifecycles Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -251,18 +251,23 @@ export default function describeCDC({
251251 if ( is ( '>= 17' ) ) {
252252 expect ( info ) . to . have . property ( 'componentStack' ) ;
253253 expect ( info . componentStack ) . to . match ( / a t T h r o w e r ( .+ ) \n / ) ;
254- } else {
255- expect ( info ) . to . deep . equal ( {
256- componentStack : `
257- in Thrower (created by ErrorBoundary)
258- in span (created by ErrorBoundary)${ hasFragments ? '' : `
259- in main (created by ErrorBoundary)` }
260- in div (created by ErrorBoundary)
261- in ErrorBoundary (created by ErrorSFC)
262- in ErrorSFC (created by WrapperComponent)
263- in WrapperComponent` ,
264- } ) ;
265- }
254+ }
255+ // else {
256+ var FILE_PATH = __filename . replace ( / ^ .* ?( \/ b u i l d ) / , '$1' ) ;
257+ var inStr = is ( '>= 17' ) ? 'at' : 'in' ;
258+ info . componentStack = info . componentStack . replace ( / ^ .* ?( \/ b u i l d ) / , '$1' ) ;
259+ info . componentStack = info . componentStack . replace ( / a t / g, inStr ) ;
260+ expect ( info ) . to . deep . equal ( {
261+ componentStack : `
262+ ${ inStr } Thrower (${ FILE_PATH } )
263+ ${ inStr } span (${ FILE_PATH } )${ hasFragments ? '' : `
264+ in main (${ FILE_PATH } )` }
265+ ${ inStr } div (${ FILE_PATH } )
266+ ${ inStr } ErrorBoundary (created by ErrorSFC)
267+ ${ inStr } ErrorSFC (created by WrapperComponent)
268+ ${ inStr } WrapperComponent` ,
269+ } ) ;
270+ // }
266271 } ) ;
267272 } ) ;
268273 } ) ;
You can’t perform that action at this time.
0 commit comments