test(plugins): initial suite
This commit is contained in:
parent
b63a43fa53
commit
da23c15ea5
32
test/specs/plugins.js
Normal file
32
test/specs/plugins.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
const test = require('tap').test
|
||||||
|
|
||||||
|
const { normalize } = require('../../dist/lib/plugins')
|
||||||
|
|
||||||
|
test('normalize and load plugin', function (t) {
|
||||||
|
|
||||||
|
t.test('load from string', (tt) => {
|
||||||
|
const plugin = normalize('../../dist/lib/plugin-noop')
|
||||||
|
|
||||||
|
tt.is(typeof plugin, 'function')
|
||||||
|
|
||||||
|
tt.end()
|
||||||
|
})
|
||||||
|
|
||||||
|
t.test('load from object', (tt) => {
|
||||||
|
const plugin = normalize({
|
||||||
|
path: '../../dist/lib/plugin-noop'
|
||||||
|
})
|
||||||
|
|
||||||
|
tt.is(typeof plugin, 'function')
|
||||||
|
|
||||||
|
tt.end()
|
||||||
|
})
|
||||||
|
|
||||||
|
t.test('load from object', (tt) => {
|
||||||
|
const plugin = normalize(null, '../../dist/lib/plugin-noop')
|
||||||
|
|
||||||
|
tt.is(typeof plugin, 'function')
|
||||||
|
|
||||||
|
tt.end()
|
||||||
|
})
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user