From 31c97a768f9e6ce1a2fab06641c2ccf1d5564c17 Mon Sep 17 00:00:00 2001 From: Kira <46629148+KiraPC@users.noreply.github.com> Date: Sun, 25 Apr 2021 23:00:07 +0200 Subject: [PATCH] increase coverage (#136) --- test/bundlers.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/bundlers.test.js b/test/bundlers.test.js index 5791edc..7ae9e39 100644 --- a/test/bundlers.test.js +++ b/test/bundlers.test.js @@ -35,6 +35,19 @@ test('support faux modules', (t) => { t.end() }) +test('support faux modules does not override existing default field in babel module', (t) => { + const module = { + default: (fastify, opts, next) => next() + } + + module.default.default = 'Existing default field' + + const plugin = fp(module) + + t.equal(plugin.default, 'Existing default field') + t.end() +}) + test('support ts named imports', (t) => { const plugin = fp((fastify, opts, next) => { next()