File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const path = require('path');
88const crypto = require ( 'crypto' ) ;
99const execFile = require ( 'child_process' ) . execFile ;
1010const env = process . env ;
11- const user = env . LOGNAME || env . USER || env . LNAME || env . USERNAME ;
11+ const user = env . LOGNAME || env . USER || env . LNAME || env . USERNAME || '' ;
1212const exclusions = [ '--help' ] ;
1313
1414const configfile = '.v8flags.' + process . versions . v8 + '.' + crypto . createHash ( 'md5' ) . update ( user ) . digest ( 'hex' ) + '.json' ;
Original file line number Diff line number Diff line change @@ -119,6 +119,17 @@ describe('v8flags', function () {
119119 delete require . cache [ require . resolve ( './' ) ] ;
120120 var v8flags = require ( './' ) ;
121121 console . log ( v8flags . configfile ) ;
122+ v8flags ( function ( err , flags ) {
123+ expect ( err ) . to . be . null ;
124+ done ( ) ;
125+ } ) ;
126+ } ) ;
127+
128+ it ( 'should handle undefined usernames' , function ( done ) {
129+ eraseHome ( ) ;
130+ delete require . cache [ require . resolve ( './' ) ] ;
131+ var v8flags = require ( './' ) ;
132+ console . log ( v8flags . configfile ) ;
122133 v8flags ( function ( err , flags ) {
123134 expect ( err ) . to . be . null ;
124135 done ( ) ;
You can’t perform that action at this time.
0 commit comments