File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,14 @@ test('read config from a .sgcrc_default', (t) => {
1616} ) ;
1717
1818test ( 'read config from package.json' , ( t ) => {
19- let sgcrc = json . readToObjSync ( path . join ( fixtures , '.sgcrc' ) ) ;
20- let packageJson = json . readToObjSync ( path . join ( cwd , 'package.json' ) ) ;
19+ const sgcrc = json . readToObjSync ( path . join ( fixtures , '.sgcrc' ) ) ;
20+ const packageJson = json . readToObjSync ( path . join ( cwd , 'package.json' ) ) ;
2121 packageJson . sgc = sgcrc ;
2222
23- fs . createReadStream ( cwd + '/package.json' )
24- . pipe ( fs . createWriteStream ( cwd + '/package.json.back' ) ) ;
25- fs . unlinkSync ( cwd + '/package.json' ) ;
26- fs . writeFileSync ( cwd + '/package.json' , JSON . stringify ( packageJson ) ) ;
23+ fs . copySync ( `${ cwd } /package.json` , `${ cwd } /package.json.back` ) ;
24+ fs . unlinkSync ( `${ cwd } /package.json` ) ;
25+ fs . writeFileSync ( `${ cwd } /package.json` , JSON . stringify ( packageJson ) ) ;
2726 t . deepEqual ( getConfig ( ) , sgcrc ) ;
28- fs . unlinkSync ( cwd + ' /package.json' ) ;
29- fs . renameSync ( cwd + ' /package.json.back' , cwd + ' /package.json' ) ;
27+ fs . unlinkSync ( ` ${ cwd } /package.json` ) ;
28+ fs . renameSync ( ` ${ cwd } /package.json.back` , ` ${ cwd } /package.json` ) ;
3029} ) ;
You can’t perform that action at this time.
0 commit comments