@@ -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
@@ -26,17 +27,18 @@ describe('runs codemods', function() {
2627 commitMessage,
2728 beforeMerge = ( ) => Promise . resolve ( )
2829 } ) {
29- tmpPath = await buildTmp ( {
30- fixturesPath
31- } ) ;
30+ // tmpPath = await buildTmp({
31+ // fixturesPath
32+ // });
33+ tmpPath = "C:\\Users\\kelly\\AppData\\Local\\Temp\\tmp-12600ZNdscU6OkirE" ;
3234
3335 await beforeMerge ( ) ;
3436
3537 return processBin ( {
3638 bin : 'ember-cli-update' ,
3739 args : [
3840 '--run-codemods' ,
39- `--codemods-json='${ JSON . stringify ( manifest ) } '`
41+ `--codemods-json='${ JSON . stringify ( manifest ) . replace ( / \\ " / g , '\\"' ) } '`
4042 ] ,
4143 cwd : tmpPath ,
4244 commitMessage,
@@ -82,10 +84,16 @@ describe('runs codemods', function() {
8284 commitMessage : 'my-app' ,
8385 runCodemods : true ,
8486 async beforeMerge ( ) {
85- await _merge ( 'local' , tmpPath ) ;
87+ // await _merge('local', tmpPath);
88+
89+ // await run('npm install', { cwd: tmpPath });
90+
91+ debugger ;
8692 }
8793 } ) ;
8894
95+ // ps.stdout.pipe(process.stdout);
96+
8997 ps . stdout . on ( 'data' , data => {
9098 let str = data . toString ( ) ;
9199 if ( str . includes ( 'These codemods apply to your project.' ) ) {
@@ -100,9 +108,17 @@ describe('runs codemods', function() {
100108 status
101109 } = await promise ;
102110
111+ assertNoUnstaged ( status ) ;
112+ assertCodemodRan ( status ) ;
113+
114+ await fs . remove ( path . join ( tmpPath , 'package-lock.json' ) ) ;
115+
103116 // file is indeterminent between OS's, so ignore
104117 await fs . remove ( path . join ( tmpPath , 'MODULE_REPORT.md' ) ) ;
105118
119+ // remove dist and node_modules before fixture compare
120+ await run ( 'git clean -fdX' , { cwd : tmpPath } ) ;
121+
106122 let nodeVersion = 'latest-node' ;
107123 if ( process . env . NODE_LTS ) {
108124 nodeVersion = 'min-node' ;
@@ -118,9 +134,6 @@ describe('runs codemods', function() {
118134 fixtureCompare ( {
119135 mergeFixtures
120136 } ) ;
121-
122- assertNoUnstaged ( status ) ;
123- assertCodemodRan ( status ) ;
124137 } ) ;
125138 }
126139} ) ;
0 commit comments