@@ -90,6 +90,38 @@ describe('e2e Tests', { timeout: 20000 }, () => {
9090 expect ( stacks [ '2' ] . frames . length ) . toEqual ( 1 ) ;
9191 } ) ;
9292
93+ test ( 'async storage state' , { timeout : 20000 } , ( ) => {
94+ const testFile = join ( __dirname , 'async-storage.mjs' ) ;
95+ const result = spawnSync ( 'node' , [ testFile ] ) ;
96+
97+ expect ( result . status ) . toEqual ( 0 ) ;
98+
99+ const stacks = JSON . parse ( result . stdout . toString ( ) ) ;
100+
101+ expect ( stacks [ '0' ] . frames ) . toEqual ( expect . arrayContaining ( [
102+ {
103+ function : 'pbkdf2Sync' ,
104+ filename : expect . any ( String ) ,
105+ lineno : expect . any ( Number ) ,
106+ colno : expect . any ( Number ) ,
107+ } ,
108+ {
109+ function : 'longWork' ,
110+ filename : expect . stringMatching ( / l o n g - w o r k .j s $ / ) ,
111+ lineno : expect . any ( Number ) ,
112+ colno : expect . any ( Number ) ,
113+ } ,
114+ {
115+ function : '?' ,
116+ filename : expect . stringMatching ( / a s y n c - s t o r a g e .m j s $ / ) ,
117+ lineno : expect . any ( Number ) ,
118+ colno : expect . any ( Number ) ,
119+ } ,
120+ ] ) ) ;
121+
122+ expect ( stacks [ '0' ] . state ) . toEqual ( { traceId : 'trace-5' } ) ;
123+ } ) ;
124+
93125 test ( 'can be disabled' , { timeout : 20000 } , ( ) => {
94126 const testFile = join ( __dirname , 'stalled-disabled.js' ) ;
95127 const result = spawnSync ( 'node' , [ testFile ] ) ;
0 commit comments