From da23c15ea51afe05ac15812a8a39f8580bccd1e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6nnemann?= Date: Thu, 18 Jun 2015 16:10:55 -0700 Subject: [PATCH] test(plugins): initial suite --- test/specs/plugins.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/specs/plugins.js diff --git a/test/specs/plugins.js b/test/specs/plugins.js new file mode 100644 index 00000000..ee1c1c5f --- /dev/null +++ b/test/specs/plugins.js @@ -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() + }) +})