Skip to content

Commit

Permalink
test: fix homedir testcase on Windows (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
popomore authored and ngot committed Oct 17, 2016
1 parent fba2943 commit 6fc2dd0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/utils/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const mm = require('mm');
const os = require('os');
const utils = require('../../lib/utils');
const should = require('should');

describe('test/utils/index.test.js', () => {

Expand All @@ -21,11 +20,9 @@ describe('test/utils/index.test.js', () => {

it('should return /home/admin when process.env.HOME is not exist', () => {
mm(process.env, 'HOME', '');
if (os.userInfo && os.userInfo().homedir) {
should.ok(utils.getHomedir().indexOf(process.env.USER) > -1);
} else {
utils.getHomedir().should.equal('/home/admin');
}
mm(os, 'userInfo', null);
mm(os, 'homedir', null);
utils.getHomedir().should.equal('/home/admin');
});
});
});

0 comments on commit 6fc2dd0

Please sign in to comment.