File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed
Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -838,7 +838,7 @@ describe.each(scenarios)("logging $name", ({ args }) => {
838838 } ) ;
839839 } ) ;
840840
841- it ( 'should logging an error in "watch" method' , ( done ) => {
841+ it ( 'should logging an error in "watch" method' , async ( ) => {
842842 const proc = execa ( runner , args , {
843843 stdio : "pipe" ,
844844 reject : false ,
@@ -847,22 +847,13 @@ describe.each(scenarios)("logging $name", ({ args }) => {
847847 } ,
848848 } ) ;
849849
850- let stderr = "" ;
851-
852- proc . stderr . on ( "data" , ( chunk ) => {
853- stderr += chunk . toString ( ) ;
850+ proc . stderr . on ( "data" , ( ) => {
854851 proc . stdin . write ( "|exit|" ) ;
855852 } ) ;
856853
857- proc . on ( "error" , ( error ) => {
858- done ( error ) ;
859- } ) ;
860-
861- proc . on ( "exit" , ( ) => {
862- expect ( stderrToSnapshot ( stderr ) ) . toMatchSnapshot ( "stderr" ) ;
854+ const result = await proc ;
863855
864- done ( ) ;
865- } ) ;
856+ expect ( stderrToSnapshot ( result . stderr ) ) . toMatchSnapshot ( "stderr" ) ;
866857 } ) ;
867858
868859 if ( os . platform ( ) !== "win32" ) {
You can’t perform that action at this time.
0 commit comments