Skip to content

Commit 57c8578

Browse files
author
Julius Celik
committedJun 26, 2020
test(load): adds test for importing plugins from an extended config
1 parent 38537d9 commit 57c8578

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['./config-with-plugins'],
3+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
extends: [],
3+
plugins: ['example', '@scope/example']
4+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./commitlint.config.js');

‎@commitlint/load/src/load.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ test('plugins should be loaded from config', async () => {
9595
});
9696
});
9797

98+
test('plugins should be loaded from shareable config', async () => {
99+
const cwd = await gitBootstrap('fixtures/extends-with-plugins');
100+
const actual = await load({}, {cwd});
101+
102+
expect(actual.plugins).toMatchObject({
103+
example: plugin,
104+
'@scope/example': scopedPlugin
105+
});
106+
});
107+
98108
test('uses seed with parserPreset', async () => {
99109
const cwd = await gitBootstrap('fixtures/parser-preset');
100110
const {parserPreset: actual} = await load(

0 commit comments

Comments
 (0)