@@ -13,11 +13,12 @@ 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
19
20
describe ( 'runs codemods' , function ( ) {
20
- this . timeout ( 5 * 60 * 1000 ) ;
21
+ // this.timeout(10 * 60 * 1000);
21
22
22
23
let tmpPath ;
23
24
@@ -26,17 +27,18 @@ describe('runs codemods', function() {
26
27
commitMessage,
27
28
beforeMerge = ( ) => Promise . resolve ( )
28
29
} ) {
29
- tmpPath = await buildTmp ( {
30
- fixturesPath
31
- } ) ;
30
+ // tmpPath = await buildTmp({
31
+ // fixturesPath
32
+ // });
33
+ tmpPath = "C:\\Users\\kelly\\AppData\\Local\\Temp\\tmp-12600ZNdscU6OkirE" ;
32
34
33
35
await beforeMerge ( ) ;
34
36
35
37
return processBin ( {
36
38
bin : 'ember-cli-update' ,
37
39
args : [
38
40
'--run-codemods' ,
39
- `--codemods-json='${ JSON . stringify ( manifest ) } '`
41
+ `--codemods-json='${ JSON . stringify ( manifest ) . replace ( / \\ " / g , '\\"' ) } '`
40
42
] ,
41
43
cwd : tmpPath ,
42
44
commitMessage,
@@ -82,10 +84,16 @@ describe('runs codemods', function() {
82
84
commitMessage : 'my-app' ,
83
85
runCodemods : true ,
84
86
async beforeMerge ( ) {
85
- await _merge ( 'local' , tmpPath ) ;
87
+ // await _merge('local', tmpPath);
88
+
89
+ // await run('npm install', { cwd: tmpPath });
90
+
91
+ debugger ;
86
92
}
87
93
} ) ;
88
94
95
+ // ps.stdout.pipe(process.stdout);
96
+
89
97
ps . stdout . on ( 'data' , data => {
90
98
let str = data . toString ( ) ;
91
99
if ( str . includes ( 'These codemods apply to your project.' ) ) {
@@ -100,9 +108,17 @@ describe('runs codemods', function() {
100
108
status
101
109
} = await promise ;
102
110
111
+ assertNoUnstaged ( status ) ;
112
+ assertCodemodRan ( status ) ;
113
+
114
+ await fs . remove ( path . join ( tmpPath , 'package-lock.json' ) ) ;
115
+
103
116
// file is indeterminent between OS's, so ignore
104
117
await fs . remove ( path . join ( tmpPath , 'MODULE_REPORT.md' ) ) ;
105
118
119
+ // remove dist and node_modules before fixture compare
120
+ await run ( 'git clean -fdX' , { cwd : tmpPath } ) ;
121
+
106
122
let nodeVersion = 'latest-node' ;
107
123
if ( process . env . NODE_LTS ) {
108
124
nodeVersion = 'min-node' ;
@@ -118,9 +134,6 @@ describe('runs codemods', function() {
118
134
fixtureCompare ( {
119
135
mergeFixtures
120
136
} ) ;
121
-
122
- assertNoUnstaged ( status ) ;
123
- assertCodemodRan ( status ) ;
124
137
} ) ;
125
138
}
126
139
} ) ;
0 commit comments