From 86e8f013a722a41231530e9e6b3739eeae089c43 Mon Sep 17 00:00:00 2001 From: Gregor Martynus <39992+gr2m@users.noreply.github.com> Date: Sat, 14 Jan 2023 13:58:42 -0800 Subject: [PATCH] test(unit): import ESM plugin with named exports --- test/plugins/utils.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/plugins/utils.test.js b/test/plugins/utils.test.js index 79524f9e..323fd55f 100644 --- a/test/plugins/utils.test.js +++ b/test/plugins/utils.test.js @@ -203,6 +203,12 @@ test("loadPlugin", async (t) => { await loadPlugin({ cwd }, "./plugin-noop.cjs", { "./plugin-noop.cjs": "./test/fixtures" }), "From a shareable config context" ); + const { ...namedExports } = await import("../fixtures/plugin-esm-named-exports.js"); + const plugin = await loadPlugin({ cwd }, "./plugin-esm-named-exports.js", { + "./plugin-esm-named-exports.js": "./test/fixtures", + }); + + t.deepEqual(namedExports, plugin, "ESM with named exports"); t.is(func, await loadPlugin({ cwd }, func, {}), "Defined as a function"); });