[Utopian.js] - Mocha & Chai unit test
This library provide a easy way to use methods on the Utopian API without any interaction of backend of a nodejs environment. Simply, you add a script tag linked to the CDN version of the library or a locally minified version of the script and you can run the methods directly in your script.
New Features
As we already know, manually testing of the methods in the script is not an efficient way to ensure functionality of the script. So, I write unit test for each one of the methods available in the script. Those were written using Mocha and Chai and are displayed in a HTML page. Basically, each test describe the function and what it is expected to return. By using assertion , it compares the datatype of the response with the expected datatype.
To ensure a more concrete result, I also added lines to assert some of the attributes in the response to ensure that the datatype is the correct one.
What are the benefits of unit test? Simple, when you make changes to the library, you just need to run the test and if all methods passed the test, the library is ready for deployment. Hence, not manually testing is needed by having the unit test.
In Brief: Mocha and Chai were added for unit testing in the library.
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Thank you so much :)
Great work with the tests.
Thank you brother from another mother and another timezone :)
Hey @jaysermendez I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Nice post.I respect you very much because you contribute to steemit.I will do activities like you.I would like to extend the steemit..