Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Mar 10, 2025
1 parent 64bfb1d commit 1420c4c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,23 @@ describe('utils.test.js', function () {
it('should work with XPROFILER_PREFIX', () => {
mm(process.env, 'XPROFILER_PREFIX', '/tmp');
const p = utils.getXprofilerPath();
assert.equal(p, '/tmp/.xprofiler');
if (os.platform() === 'win32') {
assert.equal(p, '\\tmp\\.xprofiler');
} else {
assert.equal(p, '/tmp/.xprofiler');
}
});

it('should work default is home', () => {
mm(os, 'homedir', () => {
return '/home/xxx';
});
const p = utils.getXprofilerPath();
assert.equal(p, '/home/xxx/.xprofiler');
if (os.platform() === 'win32') {
assert.equal(p, '\\home\\xxx\\.xprofiler');
} else {
assert.equal(p, '/home/xxx/.xprofiler');
}
});
});
});

0 comments on commit 1420c4c

Please sign in to comment.