So you made an open source software but it has no systematic way of showing fancy test fails when someone makes a pull request or other amazing things some good open source software are able to accomplish. In this writeup I am going to cover a few tools to make your open source software awesome!
Testing is really important; you don't want to make changes to your code and regret your app failing at production and that too on Friday.
If you're making a library or framework or any other tool then the importance of testing is a lot more than for other apps.
Basically, in a test you define what you expect a function to do, if the function misbehaves you immediately tell by seeing the test fail.
Check this awesome talk by Tomasz to learn more about tests.
Popular Tool(s) - ESlint etc.
ESLint checks the readability of the code and even formats it to make it more readable.
For example - someone might miss an indent randomly somewhere and if it gets to GitHub or any other place where you host your code then the indent results in loss of readability of code.
If you have been in the dev community for a while you must have heard people say things like - "We have achieved 100% Test Coverage."
These tools check how much of your code is being tested. So if someone decides to delete a few tests because the tests are failing for their changes you immediately known as code coverage has suffered.
If used popular they will also warn about not meeting a targeted coverage for the software.
It is recommended to target for 100% test coverage.
Uglify.js minifies your code by removing the extra spaces, comments and even shortening the variable names.
Extremely size efficient libraries like Preact rely heavily on uglifier and use very custom settings for the best optimization.
Ever saw fancy test failing in a GitHub PR, these are features that a CI/CD tool will provide.
Awesome Tools like Travis allow you to Test and Deploy your application. So, whenever you push your code to the repo or someone create pull request, Travis CI will run the code and check if the tests are passing or not.
If the tests of a PR are failing then it will give an error right there in GitHub that the tests are failing.
On an ending note, there are many other popular must have in libraries but the 5 tools I have listed are the ones that I personally really like to have.
Thanks for reading this post.
I am a 17-year-old passionate web developer and I go by @yashguptaz on the internet. Be sure to direct message me on Twitter for any help you want.