From b1d9985ba39a0cf9d2254edc5c067b8a9488da04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6nnemann?= Date: Tue, 14 Jul 2015 20:30:38 +0200 Subject: [PATCH] test(plugins): test exported plugins --- test/specs/plugins.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/test/specs/plugins.js b/test/specs/plugins.js index c585efd6..428e8a0e 100644 --- a/test/specs/plugins.js +++ b/test/specs/plugins.js @@ -1,11 +1,22 @@ 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) => { - const plugin = normalize('./dist/lib/plugin-noop') + const plugin = plugins.normalize('./dist/lib/plugin-noop') tt.is(typeof plugin, 'function') @@ -13,7 +24,7 @@ test('normalize and load plugin', function (t) { }) t.test('load from object', (tt) => { - const plugin = normalize({ + const plugin = plugins.normalize({ path: './dist/lib/plugin-noop' }) @@ -23,7 +34,7 @@ test('normalize and load plugin', function (t) { }) 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')