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

Partial Override cliConfiguration for each test #644

Open
suuunly opened this issue Oct 30, 2024 · 1 comment
Open

Partial Override cliConfiguration for each test #644

suuunly opened this issue Oct 30, 2024 · 1 comment
Labels
stale No recent activity.

Comments

@suuunly
Copy link

suuunly commented Oct 30, 2024

Is your feature request related to a problem? Please describe.
Currently, I am working with a scenario, where I need to login to my system with a specific test user. This is fine and dandy, when I specify the app specifics in the credentials.json file.

However, if I want to run my tests with various different credentials (also to be able to run the tests in isolation). I do not seem to be able to do so.

Describe the solution you'd like
The solution I can imagine, is that when using the runCommand, that I was able to provide a partial override of the this.cliConfiguration content - meaning that I can run multiple tests, with various different configurations.

Describe alternatives you've considered
one solution I found, was that I can use the dotenv package and a .env file to load in some test specific process.env properties - followed by writing custom code that picks the environment variables over the cli configuration, when present.

This kinda muddies the code more than I'd like, but it is a solution.

Additional context
We are trying to write e2e tests for our CLI, and this is why we would prefer not having to mock critical parts of the test

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale No recent activity. label Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale No recent activity.
Projects
None yet
Development

No branches or pull requests

1 participant