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