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

feat: added promptModule test helper #17

Merged
merged 2 commits into from
Jan 3, 2024
Merged

feat: added promptModule test helper #17

merged 2 commits into from
Jan 3, 2024

Conversation

wesleytodd
Copy link
Owner

@wesleytodd wesleytodd commented Oct 18, 2023

Starting work on #2. This is a wrapper around the prompt stuff to give it a bit more structure. Next step is to take one step higher up and make something more like what @boneskull mentioned which tests a whole interaction flow.

EDIT: added an end to end test helper. Still need to migrate the rest of the tests to it, but I think it is mostly there.

@wesleytodd wesleytodd force-pushed the test-helpers branch 2 times, most recently from 8ccb4ce to b394d17 Compare October 18, 2023 21:22
@wesleytodd
Copy link
Owner Author

wesleytodd commented Jan 3, 2024

I haven't been able to get back to this, but I have used it linked locally in a few projects and it is mostly working well. The next addition I want to make is to enable testing multiple prompt groups which still requires some boilerplate even with the helper, but that can be a minor release. Also still want to improve the e2e helper, but that can also be a minor release.

So with that in mind I am going to merge and release this.

@wesleytodd wesleytodd merged commit 1036e11 into main Jan 3, 2024
8 checks passed
@boneskull
Copy link

what is this even

@wesleytodd
Copy link
Owner Author

Haha, yeah I questions if I should ping you but figured if you did see it and read it it would help make sure I was not off in lalaland. So the idea is this is a helper so you can write tests which override the prompt but can still test that it calls inquirer at the right time with the right values. I used it in the tests here, but ideally this is for users of opta so they can test their packages. I honestly need to update the consumer libs of this I think for the thing to make complete sense. I used it on some internal code but have not updated any public code to use it. I can post back here when I do that.

I am assuming by this that you also mean the docs are not great? I didn't spend a ton of time on them, would revisiting that help?

@boneskull
Copy link

I was just saying I don't remember what this module is and didn't bother to look. 😄

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.

None yet

2 participants