Skip to content

Commit c4014d3

Browse files
committed
test: incorrect resolve with root, issue #326
1 parent f7c0674 commit c4014d3

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

test/config/.config-root

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
'root': './src'
3+
}

test/test-cfg-resolve.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,19 @@ test('should return config options', t => {
9191
t.deepEqual(config.options, expected);
9292
});
9393

94+
test('should return config root', t => {
95+
const input = 'input.html';
96+
const flags = {
97+
config: 'test/config/.config-root'
98+
};
99+
const config = cfgResolve({input, flags});
100+
const expectedRoot = './src';
101+
const expectedInput = [path.join(process.cwd(), expectedRoot, input)];
102+
103+
t.is(config.root, expectedRoot);
104+
t.deepEqual(config.input, expectedInput);
105+
});
106+
94107
test('should return config with key config and use key', t => {
95108
const input = 'input.html';
96109
const flags = {

0 commit comments

Comments
 (0)