Skip to content

Commit

Permalink
test(load): adds test for loading plugins from an extended config
Browse files Browse the repository at this point in the history
  • Loading branch information
Julius Celik committed Jun 26, 2020
1 parent 0fbbb47 commit 1cc4755
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['./config-with-plugins'],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
extends: [],
plugins: ['example', '@scope/example']
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./commitlint.config.js');
10 changes: 10 additions & 0 deletions @commitlint/load/src/load.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ test('plugins should be loaded from config', async () => {
});
});

test('plugins should be loaded from shareable config', async () => {
const cwd = await gitBootstrap('fixtures/extends-with-plugins');
const actual = await load({}, {cwd});

expect(actual.plugins).toMatchObject({
example: plugin,
'@scope/example': scopedPlugin
});
});

test('uses seed with parserPreset', async () => {
const cwd = await gitBootstrap('fixtures/parser-preset');
const {parserPreset: actual} = await load(
Expand Down

0 comments on commit 1cc4755

Please sign in to comment.