-
Notifications
You must be signed in to change notification settings - Fork 108
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(@clack/core,@clack/prompts): mock API #163
base: main
Are you sure you want to change the base?
Conversation
|
8d4360e
to
c44f005
Compare
Mock API
This PR introduces a set of changes aimed to enable code testing.
Changes Made
isTestMode
: serves as an internal flag to distinguish between test and production modes.exposeTestUtils
: serves as an internal function used to expose states and methods from the core Prompt component, along with additional utility functions. This exposure allows for fine-grained control over the behavior of the Prompt during testing.mockPrompt
: is a testing utility that sets the Prompt component to run in test mode. It returns all utilities configured through theexposeTestUtils
function. This is a pivotal tool for simulating user interactions and thoroughly testing our code.Observations
multiline
andgroupMultiselect
that doesn't receivevalidate
function by param, probably it should be changed by other PR.Test Coverage Result
Relates to #35