test(plugins): test exported plugins
This commit is contained in:
parent
13e2f5ce78
commit
b1d9985ba3
@ -1,11 +1,22 @@
|
|||||||
const test = require('tap').test
|
const test = require('tap').test
|
||||||
|
|
||||||
const { normalize } = require('../../dist/lib/plugins')
|
const plugins = require('../../dist/lib/plugins')
|
||||||
|
|
||||||
test('normalize and load plugin', function (t) {
|
test('export plugins', (t) => {
|
||||||
|
t.plan(4)
|
||||||
|
|
||||||
|
const defaultPlugins = plugins({})
|
||||||
|
|
||||||
|
t.is(typeof defaultPlugins.analyzeCommits, 'function')
|
||||||
|
t.is(typeof defaultPlugins.generateNotes, 'function')
|
||||||
|
t.is(typeof defaultPlugins.verifyConditions, 'function')
|
||||||
|
t.is(typeof defaultPlugins.verifyRelease, 'function')
|
||||||
|
})
|
||||||
|
|
||||||
|
test('normalize and load plugin', (t) => {
|
||||||
|
|
||||||
t.test('load from string', (tt) => {
|
t.test('load from string', (tt) => {
|
||||||
const plugin = normalize('./dist/lib/plugin-noop')
|
const plugin = plugins.normalize('./dist/lib/plugin-noop')
|
||||||
|
|
||||||
tt.is(typeof plugin, 'function')
|
tt.is(typeof plugin, 'function')
|
||||||
|
|
||||||
@ -13,7 +24,7 @@ test('normalize and load plugin', function (t) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.test('load from object', (tt) => {
|
t.test('load from object', (tt) => {
|
||||||
const plugin = normalize({
|
const plugin = plugins.normalize({
|
||||||
path: './dist/lib/plugin-noop'
|
path: './dist/lib/plugin-noop'
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -23,7 +34,7 @@ test('normalize and load plugin', function (t) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.test('load from object', (tt) => {
|
t.test('load from object', (tt) => {
|
||||||
const plugin = normalize(null, '../../dist/lib/plugin-noop')
|
const plugin = plugins.normalize(null, '../../dist/lib/plugin-noop')
|
||||||
|
|
||||||
tt.is(typeof plugin, 'function')
|
tt.is(typeof plugin, 'function')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user