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

Add tests to your code #818

Open
ccoVeille opened this issue Jan 22, 2025 · 4 comments
Open

Add tests to your code #818

ccoVeille opened this issue Jan 22, 2025 · 4 comments

Comments

@ccoVeille
Copy link
Contributor

ccoVeille commented Jan 22, 2025

Is your feature request related to a problem? Please describe.

I feel annoyed by the fact the code is barely tested.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Add tests, please.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Hope nothing will get broken on each commits and trust maintainers 😅

Additional context
Add any other context or screenshots about the feature request here.

@caarlos0
Copy link
Member

we're definitely suffering from this!

this is also an easy way to contribute, if anyone is interested :)

@ccoVeille
Copy link
Contributor Author

ccoVeille commented Jan 22, 2025

I would say you should start a bit to do it.
This way tests will be your ways.

Because from here our discussion might sound like 🤣

Parent (me): Hey Carlos, could you please clean your room ?
You: Yes, I know ... but don't you want to help me ?"

Joke aside, I would like you to start testing the code you add, otherwise the flow will never stop.

@caarlos0
Copy link
Member

fair enough! 😆

@caarlos0
Copy link
Member

gonna brain dump some stuff here, more as a means of noting them to future me than anything else :P

  1. commands will need a way to set stdout/stderr/stdin for we to be able to test them
  2. incidentally, commands will need to adjust usage (e.g. use fmt.Fprint instead of fmt.Print)
  3. might need some restructuring to allow us to use teatest (this will be easier with the v2 stack)
  4. we might benefit from start listing expected behaviors from each sub command before doing the above

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