-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.js
More file actions
27 lines (24 loc) · 774 Bytes
/
Copy pathtest.js
File metadata and controls
27 lines (24 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'use strict';
require('mocha');
const fs = require('fs');
const os = require('os');
const path = require('path');
const assert = require('assert');
const gitconfig = require('./');
describe('gitconfig', () => {
it('should resolve the path to the local .gitconfig:', () => {
let fp = path.resolve(process.cwd(), '.git/config');
if (fs.existsSync(fp)) {
assert.equal(fp, gitconfig());
assert.equal(fp, gitconfig('local'));
assert.equal(fp, gitconfig({type: 'local'}));
}
});
it('should resolve the path to the global .gitconfig:', () => {
let fp = path.resolve(os.homedir(), '.gitconfig');
if (fs.existsSync(fp)) {
assert.equal(fp, gitconfig({type: 'global'}));
assert.equal(fp, gitconfig('global'));
}
});
});