qcarpentier / lovelace

Lovelace is (not yet) the best Discord bot to bootstrap your Discord server.
1 stars 0 forks source link

Setting up unit tests #12

Closed SirMishaa closed 4 years ago

SirMishaa commented 4 years ago

Having unit tests is essential to have a solid application and to track bugs.

We have to choose between three testing frameworks :

These are the most popular and most used. In line with Grafikart's series on the subject, I'm thinking about choosing Mocha for the following reason :

Mocha is a rather peculiar framework, because it comes with no library to manage assertions and no way to create Mocks. The advantage is that we will be able to use the modules we want to use to manage these tasks and adapt the Framework to our desires.

I will first follow the Grafikart series in order to be comfortable with the unit tests in Javascript and to choose the most suitable and adequate test framework.

Don't hesitate also to give me your opinions.

qcarpentier commented 4 years ago

Mocha seems to be ok and easy to handle. Also see this article: https://www.codementor.io/@codementorteam/javascript-testing-framework-comparison-jasmine-vs-mocha-8s9k27za3