File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,14 +102,32 @@ describe('bin acceptance', function() {
102102 } ) ;
103103
104104 it ( 'works' , function ( ) {
105- cp . spawnSync ( 'node' , [
106- path . join ( process . cwd ( ) , 'bin/ember-modules-codemod' )
107- ] , {
108- cwd : tmpPath ,
109- stdio : 'inherit'
110- } ) ;
105+ let stdout = '' ;
106+ let exitCode ;
107+
108+ return new Promise ( resolve => {
109+ let ps = cp . spawn ( 'node' , [
110+ path . join ( process . cwd ( ) , 'bin/ember-modules-codemod' )
111+ ] , {
112+ cwd : tmpPath
113+ } ) ;
114+
115+ ps . stdout . on ( 'data' , data => {
116+ stdout += data . toString ( ) ;
117+ } ) ;
111118
112- expect ( fs . readFileSync ( tmpFile , 'utf8' ) ) . toEqual ( fs . readFileSync ( outputFile , 'utf8' ) ) ;
119+ ps . on ( 'exit' , ( code , signal ) => {
120+ exitCode = code ;
121+
122+ resolve ( ) ;
123+ } ) ;
124+ } ) . then ( ( ) => {
125+ expect ( exitCode ) . toEqual ( 0 ) ;
126+
127+ expect ( stdout ) . toMatch ( 'Done! All uses of the Ember global have been updated.\n' ) ;
128+
129+ expect ( fs . readFileSync ( tmpFile , 'utf8' ) ) . toEqual ( fs . readFileSync ( outputFile , 'utf8' ) ) ;
130+ } ) ;
113131 } ) ;
114132 } ) ;
115133 } ) ;
You can’t perform that action at this time.
0 commit comments