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

Suggestion: add fs option to question, for substituting other filesystem implementations #92

Open
ajvincent opened this issue Jan 5, 2023 · 1 comment

Comments

@ajvincent
Copy link

I'm writing a configuration wizard using this project, along with memfs and unionfs to manage a temporary file system as an overlay on top of the existing real file system. I really would like to pass in the temporary file system I built from unionfs as an override.

There are precisely two uses of fs in src/index/index.ts. This could be a pretty straight-forward fix.

On a related note, I did some experiments with enquirer a couple days ago. I was running prompts through a child process and driving it through stdin and stdout. The goal was to add automated tests. I see no reason I couldn't do the same here, if there's a desire for it. I just need to know what testing framework you'd prefer.

@anc95
Copy link
Owner

anc95 commented Jan 13, 2023

@ajvincent Sorry for the late reply.

For the first one, sure, we can add a fs config, so the user can pass their custom fs such as memfs.

The second one, I am very interested in the automated tool you are working on, I think it's helpful for some terminal-related tools testing, I prefer jest and vitest for the test job. Looking forward to your update about the automated test tool.

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

No branches or pull requests

2 participants