Skip to main content

What I use - testing

· 2 min read
Luke Owen
Lead Front End Developer @ Lunio

Testing is an important part of the development process, and I use a few tools to make my life easier:

Jest

Jest is a JavaScript testing framework, I primarily use it for unit-testing React components along with Enzyme. Unit tests are the first line of defence against bugs, and React components are pretty easy to test because they’re self-contained.

With Jest I can also write snapshot tests: taking a copy of the component output and checking to see if anything has changed, they’re handy to confirm that you didn’t unexpectedly change something.

My tests usually end up around a 70/30 split between unit tests and snapshots.

Pa11y

I use Pa11y for automated accessibility testing. It runs on the command line to produce an accessibility report.

Ghostlab

I use Ghostlab for cross-device testing, it allows me to synchronise a website across multiple physical devices.

There is absolutely no better way to test how a site will look than actually seeing it run on the device, and Ghostlab means I can control the same website on several devices and browsers simultaneously.

BrowserStack

BrowserStack has never been my favourite tool as it’ll never be the same as testing on an actual device. That being said, it does have its uses.

I use it to quickly debug issues that have been reported in specific browsers, as it allows me to switch versions quickly. I also sometimes use it for mobile testing (usually when I don’t have an Android device to hand).

Cypress

Cypress is my go-to for end-to-end testing, I used to use Nightwatch but I find Cypress easier to get up and running.

This is the final stage of the testing process, Cypress interacts with the system exactly as a user would. It makes sure all parts of the system work together as intended.