@@ -13,6 +13,7 @@ const {
13
13
assertCodemodRan
14
14
} = require ( './helpers/assertions' ) ;
15
15
const manifest = require ( '../manifest' ) ;
16
+ const run = require ( 'ember-cli-update/src/run' ) ;
16
17
17
18
const codemods = Object . keys ( manifest ) ;
18
19
@@ -83,9 +84,15 @@ describe('runs codemods', function() {
83
84
runCodemods : true ,
84
85
async beforeMerge ( ) {
85
86
await _merge ( 'local' , tmpPath ) ;
87
+
88
+ if ( manifest [ codemod ] . script ) {
89
+ await run ( 'npm install' , { cwd : tmpPath } ) ;
90
+ }
86
91
}
87
92
} ) ;
88
93
94
+ ps . stdout . pipe ( process . stdout ) ;
95
+
89
96
function stdoutData ( data ) {
90
97
let str = data . toString ( ) ;
91
98
if ( str . includes ( 'These codemods apply to your project.' ) ) {
@@ -104,9 +111,17 @@ describe('runs codemods', function() {
104
111
status
105
112
} = await promise ;
106
113
114
+ assertNoUnstaged ( status ) ;
115
+ assertCodemodRan ( status ) ;
116
+
117
+ await fs . remove ( path . join ( tmpPath , 'package-lock.json' ) ) ;
118
+
107
119
// file is indeterminent between OS's, so ignore
108
120
await fs . remove ( path . join ( tmpPath , 'MODULE_REPORT.md' ) ) ;
109
121
122
+ // remove dist and node_modules before fixture compare
123
+ await run ( 'git clean -fdX' , { cwd : tmpPath } ) ;
124
+
110
125
let nodeVersion = 'latest-node' ;
111
126
if ( process . env . NODE_LTS ) {
112
127
nodeVersion = 'min-node' ;
@@ -122,9 +137,6 @@ describe('runs codemods', function() {
122
137
fixtureCompare ( {
123
138
mergeFixtures
124
139
} ) ;
125
-
126
- assertNoUnstaged ( status ) ;
127
- assertCodemodRan ( status ) ;
128
140
} ) ;
129
141
}
130
142
} ) ;
0 commit comments