@@ -33,6 +33,7 @@ var path = require('path');
3333var spawn = require ( 'child_process' ) . spawn ;
3434var which = require ( 'which' ) ;
3535var _ = require ( 'lodash' ) ;
36+ var fs = require ( 'fs-extra' ) ;
3637
3738var args = [
3839 /**
@@ -74,15 +75,18 @@ var opts = {
7475} ;
7576
7677which ( 'electron-mocha' , function ( err , bin ) {
77- cli . abortIfError ( err ) ;
78- cli . debug ( 'Using electron-mocha: ' , bin ) ;
78+ fs . remove ( path . resolve ( __dirname , '..' , '.user-data' ) , function ( ) {
79+ cli . debug ( 'Removed .user-data directory' ) ;
80+ cli . abortIfError ( err ) ;
81+ cli . debug ( 'Using electron-mocha: ' , bin ) ;
7982
80- var proc = spawn ( bin , args , opts ) ;
81- proc . stderr . pipe ( process . stderr ) ;
82- proc . stdout . pipe ( process . stdout ) ;
83- process . stdin . pipe ( proc . stdin ) ;
83+ var proc = spawn ( bin , args , opts ) ;
84+ proc . stderr . pipe ( process . stderr ) ;
85+ proc . stdout . pipe ( process . stdout ) ;
86+ process . stdin . pipe ( proc . stdin ) ;
8487
85- proc . on ( 'exit' , function ( code ) {
86- process . exit ( code ) ;
88+ proc . on ( 'exit' , function ( code ) {
89+ process . exit ( code ) ;
90+ } ) ;
8791 } ) ;
8892} ) ;
0 commit comments