I feel so elated right now! I came across this project, a benchmark runner for OrbitDB. To be frank, I actually came across this issue when I was looking for a repo I could contribute to, as part of the Hacktoberfest that’s being run by DigitalOcean. This was going to be my first official PR and I felt adding tests would be something I could start with.
It was not as easy as I expected. I added Mocha as the testing framework (I was so used to Jest and Jasmine before this), with SinonJS for mocks/stubs and ChaiJS for better assertion statements. But the main challenge was figuring out how to test cli commands.
yargs
is a nodejs library that helps in building command line tools. I had no clue how to go about testing it. I looked around the web and was finally able to figure out how to go about it.
You can see what I have done here:
Add Testing Framework with tests #5
Added Mocha as testing framework and SinonJS for mocks and stubs.
Let me know what you think about this. I would also love to know how you made your first contribution to open source!
Top comments (0)