Never miss a beat

Join my newsletter.

Tag: testing

Testing React Components with React Testing Library

Published: 2/15/2020

Testing react components with React Testing Library can be tricky, so I decided to try something new and put together a video demonstrating how to test your react components. I’ll work on improving the audio quality going forward, but I’d love to know your thoughts! Wanna see more content like this in the future? Lemme know!

Testing a Cobra CLI in Go

Published: 7/18/2019

Go has a fantastic library for writing CLI’s (Command Line Interfaces) called Cobra . I’ve been working on a CLI named Deckard for a few months now. Being new to Go, I had (lazily) shied away from writing tests. However, after thinking about my test plan and doing a little refactoring, I’ve found a great way to handle testing your Cobra CLI application. The idea behind Cobra is that you simply write “Command” functions. These command functions are then called by the Cobra library when it…

BDD Assertions with Expekt for Kotlin

Published: 10/26/2018

Behavior-Driven Development (BDD) has became quite a popular strategy for writing tests in the past ten or so years. BDD is a style of test-writing that focuses on test cases that flow like natural English sentences. Expekt is one such library for writing JUnit assertions in Kotlin. Combining JUnit and Expekt you can achieve results like this: Adding Expekt to Your Project As of writing, the current version of Expekt is 0.5.0 so that’s the one we’ll include in our project. If you’re using…

Static Methods, Companion Objects, and Testing

Published: 7/18/2018

A companion object sits inside a class definition and houses all the static methods which that class will own. Let's convert a piece of Java code to Kotlin so you can see what I mean.

A brief summary on Automated Testing

Published: 8/20/2016

I recently read this amazing article by Josh Mock and felt the need to share it. In fact, the tools he uses in his examples – JavaScript, Mocha+Chai, and Phantom are the tools I use daily to do the same thing. I can’t stress enough how great his article is, especially if you’ve written some tests before but you’re not sure how to write a good test. That being said, there’s a few more things I’d like to cover and add to it. In summary, Josh covers the following things: Keep Business and…