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

write tests using bats framework #19

Open
Bhupesh-V opened this issue Jun 8, 2021 · 3 comments
Open

write tests using bats framework #19

Bhupesh-V opened this issue Jun 8, 2021 · 3 comments
Labels
advanced Requires extensive research & learning help wanted Extra attention is needed requires-research

Comments

@Bhupesh-V
Copy link
Owner

Ever wrote tests for a script?
We need to use bats
Check out projects using bats for examples

Since this is a weird use case, we need to figure out what things to test or not. Suggestions are welcome

@Bhupesh-V Bhupesh-V added the help wanted Extra attention is needed label Jun 8, 2021
@Bhupesh-V Bhupesh-V added the advanced Requires extensive research & learning label Aug 2, 2022
@Bhupesh-V Bhupesh-V pinned this issue Aug 26, 2022
@Bhupesh-V Bhupesh-V changed the title write tests write tests using bats framework Aug 26, 2022
@kopalchakravarty
Copy link
Contributor

@Bhupesh-V I'd like to work on this.

Do you have something in mind that we could use as a baseline?

@Bhupesh-V
Copy link
Owner Author

@Bhupesh-V I'd like to work on this.

Do you have something in mind that we could use as a baseline?

Hey have been doing some research, seems like there is lot to think about. The fundamental problem to figure out is how do we mock the execution of fzf command in bats. Since its deeply integrated within ugit.

Another tool I tried using was shellspec for testing, but as it turns out it doesn't support testing colored output.
Ref: shellspec/shellspec#278

Not really sure how to proceed further at the moment. If you are able to find something, do let me know in the thread.

@LukeSavefrogs
Copy link

Another tool I tried using was shellspec for testing, but as it turns out it doesn't support testing colored output.
Ref: shellspec/shellspec#278

See my answer on that issue...

The solution to make it work is to use custom matchers.

@Bhupesh-V Bhupesh-V unpinned this issue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advanced Requires extensive research & learning help wanted Extra attention is needed requires-research
Projects
None yet
Development

No branches or pull requests

3 participants