Steven Senkus

Software Developer living in 🌞 sunny, 🌞 sunny San Diego

Writing Better JavaScript Unit Tests - Scenarios

When you have a function or class method that can take many conditional paths and varying parameters, it can be tempting to write a lot of unit tests to brute force your way to complete code coverage. While this approach works, you end up repeating common test tasks like setup, initialization, and teardown. Unit test files will end up with a lot of duplication, which will make it difficult to refactor once requirements change. Read more →