Skip to content

Commit 11126f1

Browse files
committed
Add getCofig test
1 parent 8ae80f0 commit 11126f1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/getConfig.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import test from 'ava';
2+
import path from 'path';
3+
import json from 'json-extra';
4+
import getConfig from '../lib/getConfig';
5+
6+
const cwd = process.cwd();
7+
const fixtures = path.join(cwd, 'test', 'fixtures');
8+
9+
test('read config from a specific path', (t) => {
10+
t.deepEqual(getConfig(path.join(fixtures, '.sgcrc')), json.readToObjSync(path.join(fixtures, '.sgcrc')))
11+
});
12+
13+
test('read config from package.json', (t) => {
14+
t.deepEqual(getConfig(), json.readToObjSync(path.join(fixtures, '.sgcrc')))
15+
});

0 commit comments

Comments
 (0)