Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: inherit config #394

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

fix: inherit config #394

wants to merge 5 commits into from

Conversation

moltar
Copy link

@moltar moltar commented Sep 4, 2023

Pass configuration from main plop to loaded plops.

Did not add tests, as I could not find anywhere to hook into to check the config values. Config is not exposed directly and doesn't seem to be exposed indirectly either. But I added a stub test, in case you know where to hook into and want to fix this quickly, or let me know and I can add another commit for the test.

Closes: #392

@@ -173,4 +173,15 @@ describe("load-assets-from-plopfile", function () {
expect(plop.getPartialList().length).toBe(1);
expect(plop.getPartialList()[0]).toBe("p1");
});

test.todo("plop.load loaded plopfile inherits config", async function () {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

Copy link
Member

@crutchcorn crutchcorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! Let's make this an E2E test given your findings on config test challenges before we merge

packages/node-plop/src/node-plop.js Show resolved Hide resolved
Comment on lines 177 to 186
test.todo("plop.load loaded plopfile inherits config", async function () {
const plop = await nodePlop("", {
force: true,
});

await plop.load(plopfilePath, null, {});

// not a working test
expect(plop.config.force).toBe(true);
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a TODO test, let's add an e2e test using Plop CLI :)

Copy link
Author

@moltar moltar Sep 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e2e test using Plop CLI

Is there a prior art for this?

Can't find anything like that in the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loaded plopfiles do not respect the --force flag
2 participants