@@ -13,11 +13,12 @@ const {
1313 assertCodemodRan
1414} = require ( './helpers/assertions' ) ;
1515const manifest = require ( '../manifest' ) ;
16+ const run = require ( 'ember-cli-update/src/run' ) ;
1617
1718const codemods = Object . keys ( manifest ) ;
1819
1920describe ( 'runs codemods' , function ( ) {
20- this . timeout ( 5 * 60 * 1000 ) ;
21+ this . timeout ( 10 * 60 * 1000 ) ;
2122
2223 let tmpPath ;
2324
@@ -83,9 +84,15 @@ describe('runs codemods', function() {
8384 runCodemods : true ,
8485 async beforeMerge ( ) {
8586 await _merge ( 'local' , tmpPath ) ;
87+
88+ if ( manifest [ codemod ] . script ) {
89+ await run ( 'npm install' , { cwd : tmpPath } ) ;
90+ }
8691 }
8792 } ) ;
8893
94+ ps . stdout . pipe ( process . stdout ) ;
95+
8996 function stdoutData ( data ) {
9097 let str = data . toString ( ) ;
9198 if ( str . includes ( 'These codemods apply to your project.' ) ) {
@@ -104,9 +111,17 @@ describe('runs codemods', function() {
104111 status
105112 } = await promise ;
106113
114+ assertNoUnstaged ( status ) ;
115+ assertCodemodRan ( status ) ;
116+
117+ await fs . remove ( path . join ( tmpPath , 'package-lock.json' ) ) ;
118+
107119 // file is indeterminent between OS's, so ignore
108120 await fs . remove ( path . join ( tmpPath , 'MODULE_REPORT.md' ) ) ;
109121
122+ // remove dist and node_modules before fixture compare
123+ await run ( 'git clean -fdX' , { cwd : tmpPath } ) ;
124+
110125 let nodeVersion = 'latest-node' ;
111126 if ( process . env . NODE_LTS ) {
112127 nodeVersion = 'min-node' ;
@@ -122,9 +137,6 @@ describe('runs codemods', function() {
122137 fixtureCompare ( {
123138 mergeFixtures
124139 } ) ;
125-
126- assertNoUnstaged ( status ) ;
127- assertCodemodRan ( status ) ;
128140 } ) ;
129141 }
130142} ) ;
0 commit comments