@@ -33,6 +33,7 @@ var path = require('path');
33
33
var spawn = require ( 'child_process' ) . spawn ;
34
34
var which = require ( 'which' ) ;
35
35
var _ = require ( 'lodash' ) ;
36
+ var fs = require ( 'fs-extra' ) ;
36
37
37
38
var args = [
38
39
/**
@@ -74,15 +75,18 @@ var opts = {
74
75
} ;
75
76
76
77
which ( '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 ) ;
79
82
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 ) ;
84
87
85
- proc . on ( 'exit' , function ( code ) {
86
- process . exit ( code ) ;
88
+ proc . on ( 'exit' , function ( code ) {
89
+ process . exit ( code ) ;
90
+ } ) ;
87
91
} ) ;
88
92
} ) ;
0 commit comments