Tests are a complex if not polemic topic. TDD or not TDD, not every automated test is an unit test, not every unit test needs to be automated. But frameworks have to be deployed to guarantee regression tests, which is how you know that the feature of fix being introduced now won’t break anything that was working perfectly before.
This project uses Mocha for that, only because it’s the one I learned first and always used in the past. I sincerely can’t say anything about the others but I’ll sure give Jest a try. It has increased its popularity this year and I ought to know why.
--require ts-node/register as a command line parameter.
To make the tests semantically pleasant, we use Chai. it’s an assertion library and has the sole function of turning this:
res.status.should.be.equal(200); // or... expect(res.status).to.be.equal(200);
It may look foolish, but after a couple hundred tests, semantically pleasant code makes a difference.