1. An idea around specsMarch 12, 2017
My intention is to create a practical guide to writing specs. More important than knowing how is knowing why to write specs.
2. The structure of a mocha testApril 27, 2017
As I said in the introduction you can select one of the various available interfaces. My favourite is BDD and this is the interface I’m going to present here. The main goal of this interface is to help you write specs as grammatically correct sentences.
3. Making assertions with ChaiJune 17, 2017
As mentioned in the structure, a test case goes red when anything in the
it block throws an exception. First of all, by calling a function in specs we expect that it has been executed without any error. If the code seems to be pretty simple and writing specs for it sounds like a waste of time, it’s still worth to have them, at least for this information.