test(unit): import ESM plugin with named exports
This commit is contained in:
parent
f6c978cd9e
commit
86e8f013a7
@ -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");
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user