This article references features of the Mocha testing library available from v8.2.0 onwards.

At LeaseLock, we take pride in our codebase’s ~93% test coverage. Despite being a small team, we rarely introduce new functionality without accompanying tests — this rule has served us well by keeping us away from silly mistakes. At the time of writing, we have just over 3,000 test cases in our test suite powered by Mocha and Chai.

A Good Problem to Have

While most of our tests are rapid-fire unit tests, there are a significant number of integration and end-to-end tests that hit our test database. …

Photo by Victor Garcia

As we gear ourselves up to eliminate security deposits from rental properties across the country, we are always looking for areas of improvement in our developer tooling in anticipation of a growing team.

In a previous blog post, we explained how we significantly improved our test suite runtime. Since then, we tackled another weak point of our test tooling: fixtures.

Fixtures don’t need to be artisanal

The core issue with our fixture setup is that we have to hand-craft them. Our fixtures are JSON files that we use to seed the database for our integration tests. In an effort to keep our fixtures directory somewhat reasonable…

Timothy Ng

Senior Software Engineer at LeaseLock

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store