Skip to content

Commit b2e5082

Browse files
RobinKnipecrutchcorn
authored andcommitted
Add a unit test
Make sure the proposed changes actually work!
1 parent 221baba commit b2e5082

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/node-plop/tests/load-assets-from-plopfile/load-assets-from-plopfile.spec.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ describe("load-assets-from-plopfile", function () {
9393
expect(plop.getActionTypeList().includes("test-actionType1")).toBe(true);
9494
});
9595

96+
test("plop.load passes a config option that can be used to include all the plopfile output", async function () {
97+
const plop = await nodePlop();
98+
plop.load(plopfilePath, { prefix: "test-" }, true);
99+
100+
const gNameList = plop.getGeneratorList().map((g) => g.name);
101+
expect(gNameList.length).toBe(3);
102+
expect(plop.getHelperList().length).toBe(3);
103+
expect(plop.getPartialList().length).toBe(3);
104+
expect(plop.getActionTypeList().length).toBe(1);
105+
expect(gNameList.includes("test-generator1")).toBe(true);
106+
expect(plop.getHelperList().includes("test-helper2")).toBe(true);
107+
expect(plop.getPartialList().includes("test-partial3")).toBe(true);
108+
expect(plop.getActionTypeList().includes("test-actionType1")).toBe(true);
109+
});
110+
96111
test("plop.load should import functioning assets", async function () {
97112
const plop = await nodePlop();
98113
await plop.load(

0 commit comments

Comments
 (0)