@@ -7,7 +7,6 @@ let child = require("child_process");
77let path = require ( "path" ) ;
88let chai = require ( "chai" ) ;
99let fs = require ( "fs" ) ;
10- let pathExists = require ( "path-exists" ) ;
1110let _ = require ( "lodash" ) ;
1211
1312let fixtureLoc = path . join ( __dirname , "fixtures" ) ;
@@ -25,7 +24,7 @@ let pluginLocs = [
2524
2625let readDir = function ( loc ) {
2726 let files = { } ;
28- if ( pathExists . sync ( loc ) ) {
27+ if ( fs . existsSync ( loc ) ) {
2928 _ . each ( readdir ( loc ) , function ( filename ) {
3029 files [ filename ] = helper . readFile ( path . join ( loc , filename ) ) ;
3130 } ) ;
@@ -130,7 +129,7 @@ let buildTest = function (binName, testName, opts) {
130129
131130let clear = function ( ) {
132131 process . chdir ( __dirname ) ;
133- if ( pathExists . sync ( tmpLoc ) ) rimraf . sync ( tmpLoc ) ;
132+ if ( fs . existsSync ( tmpLoc ) ) rimraf . sync ( tmpLoc ) ;
134133 fs . mkdirSync ( tmpLoc ) ;
135134 process . chdir ( tmpLoc ) ;
136135} ;
@@ -150,11 +149,11 @@ _.each(fs.readdirSync(fixtureLoc), function (binName) {
150149 } ;
151150
152151 let optionsLoc = path . join ( testLoc , "options.json" ) ;
153- if ( pathExists . sync ( optionsLoc ) ) _ . merge ( opts , require ( optionsLoc ) ) ;
152+ if ( fs . existsSync ( optionsLoc ) ) _ . merge ( opts , require ( optionsLoc ) ) ;
154153
155154 _ . each ( [ "stdout" , "stdin" , "stderr" ] , function ( key ) {
156155 let loc = path . join ( testLoc , key + ".txt" ) ;
157- if ( pathExists . sync ( loc ) ) {
156+ if ( fs . existsSync ( loc ) ) {
158157 opts [ key ] = helper . readFile ( loc ) ;
159158 } else {
160159 opts [ key ] = opts [ key ] || "" ;
@@ -165,7 +164,7 @@ _.each(fs.readdirSync(fixtureLoc), function (binName) {
165164 opts . inFiles = readDir ( path . join ( testLoc , "in-files" ) ) ;
166165
167166 let babelrcLoc = path . join ( testLoc , ".babelrc" ) ;
168- if ( pathExists . sync ( babelrcLoc ) ) {
167+ if ( fs . existsSync ( babelrcLoc ) ) {
169168 // copy .babelrc file to tmp directory
170169 opts . inFiles [ ".babelrc" ] = helper . readFile ( babelrcLoc ) ;
171170 }
0 commit comments