Testing your code is one of those things that a lot of folks agree is a good idea, but that as an industry we generally don't do enough. And I personally think a lot of that is because JavaScript testing often feels complicated, time-consuming, and over-engineered. Personally, I think a lot of that comes from testing evangelists themselves, who often obsess over the the different types of tests and perpetuate complicated Rube Goldberg machines of automated testing. Today, I wanted to share some thoughts on "good enough" testing the Lean Web way. Let's dig in! The types of tests are… mehI've wasted a lot of bandwidth trying to wrap my head around the difference between unit, integration, and end-to-end tests. And I'm not the only one. Chris Coyier had a great post back in 2022 about this very topic. He wrestled with the same thing I did: integration tests are weird and it's kind of a term without value. A few years back, testing specialist Justin Searls said something that really resonates with me…
As I shared the other day, my friend Alex Riviere wrote a good post on how it's probably smarter to focus on what you're trying to test. That will determine the tool you use. What you call the test is mostly irrelevant. I'm starting to think about code you'd test as two types (versus Alex's three)…
In my mind, these are the two big things you test, and you have a few different tools you'll use in combination to test them. The toolsI'm now thinking about my tools in three buckets…
What's the right mix?There isn't one, really. It depends on what your code is doing. Generally, I'm starting to think about testing like this…
Standard caveats here:
This is how I'm thinking about testing. Your wants, needs, and experiences may differ, and that's fine too! Tomorrow, we'll take a look at behavior or unit testing in a bit more detail. Cheers, Want to share this with others or read it later? View it in a browser. |
0 Komentar untuk "[Go Make Things] An overview of JavaScript testing"