Have you ever been dropped into a new project and asked to increase test coverage? Have you needed to provide confidence in the code, lower production failures, and make selling the stability of your product easier? You are likely in the daunting position of adding tests to a large (probably legacy) codebase. Tests provide value […]
Pytest’s fixtures are a pretty convenient route to dependency injection throughout your tests. They’re flexible, too, and involve very little “magic.” This means they’re easy to learn, understand, and use correctly. The Pytest documentation explains that a fixture can pass back anything to the caller, including a function. This allows you to essentially create parameterized […]
When I first started to learn about testing, I found out about test plans. They looked impressive and professional. Many templates were available, with specific figures on how many P1, P2, and P3 defects were allowed before testing could move to a different phase, how many cycles of testing there would be, etc. They even […]
Storybook can be really useful for a team developing a web app. But like any software, it’s prone to rot when left untested. On my current project, I finally have a good way to test it. Here’s how!
On a recent project, we used Jest to orchestrate the tests across our web app, which uses a combination of Puppeteer, SuperTest, and Enzyme for testing. Here’s an overview of how we wired up and tested each part of the app, the tools/libraries we used, and the orchestration we did to run all of the […]
Laravel’s Artisan CLI comes with a plethora of useful commands and functionality out of the box. Unfortunately, there’s one thing it doesn’t come with: an easy way to run different types of tests. On a recent project, our team had a desire to write Artisan commands that could run our tests, so we had one […]
Since the summer of 2019, WebdriverIO has fully supported the W3C WebDriver protocol (announced in this post). As part of upgrading to the latest v5 version of WebdriverIO, I decided to also switch over to using the W3C protocol for our tests that use Chrome / ChromeDriver. After switching to the W3C protocol, we found […]
On my current project, we’re using LocalStack in lieu of AWS for development and test. In this post, I’ll walk through how we’ve set it up and what we can do with it.
These days, it’s standard practice to run your unit and system tests with some degree of parallelism. When doing so, it’s important to ensure that the code being tested doesn’t interfere with other running tests. Usually, this comes down to the database layer. There are a few options for accomplishing isolation at the database layer. […]
When writing tests for a Node.js server, it’s common to test the database as well. (At least, one hopes.) Here are a few helper functions for testing a PostgreSQL database using Knex.