So when we get to this case 5, and eventually I think it's case 7, things get a bit more interesting. Because the question that I asked the people in these interviews was a very simple one. Could you just tell me what is your testing stack look like, and what type of tests you're writing? How do you test? And I think with case 5, it's where I first heard people mention mock service worker. I've been using mock service worker for years. We'll get to it in this talk. But this is the first company that told me, yeah, we have Jest and React Testing Library for integration, Playwright for end-to-end, but now we're also using mock service worker and a custom mocking tool for mocking our network requests and others. Case 6, Jest and React Testing Library for unit integration. And the case 7 was actually the first person to ever mention static analysis. If we're talking about the testing trophy, which we'll talk about in a bit, static analysis is a great part of it. And in this case 7, they're using TypeScript and ESLint for doing some static analysis. VTest and React Testing Library for unit integration, and Playwright for end-to-end. Finally, for case 8, we have Cypress for end-to-end, Enzyme and React Testing Library for unit integration, and MSW with a custom mocking tool, and a custom mocking tool. So, this is a bit of an overview that goes for 8 different companies in 8 different contexts. And it's a very interesting thing when I was doing this talk, because now, when we have been taught the testing trophy and Kent Cedald has explained this to us, and we have learned this from the past few years, we always thought about these 4 topics, end-to-end, integration, unit, static, even though a couple of them got a bit blurry throughout the years, these have been the testing points that keep us safe. So I thought, okay, let's use these 4 points, the static analysis, the unit integration, and the end-to-end to see how are we doing tests and what's the current standard for using these things.
Let's start with static analysis. Let's start from the bottom and go up from there. Well, to no one's surprise, TypeScript and ESLint are still the standard for doing static analysis. They are more than proven, they're battle-hardened, and I don't see anyone saying that they don't want to use them. If I would have you something to keep in mind and keep under your radar is to check Biome and OXC. There's some interesting developments happening there from a static analysis perspective, and I've actually seen a couple of people migrating out of ESLint to Biome already, and some organizations, so they're here, they're giving a couple of people already some different decisions and different tests, so this is basically my analysis for the static analysis part.
Now, let's spend a bit more time talking about unit and integration testing, because this is the one that I think most of us get excited about, let's say excited. For that, I wanted to do a timeline, because, well, a couple years we were writing tests, a couple years, ten years ago or so, this is where we were. We had a bunch of tests using Karma and we were using Jasmine, and these were all component testing. These tests run in an actual browser, but we had a couple of issues with this. First of all, these tests were not always reliable, they were a bit flaky, the browsers were always crashing, and let's not talk about how the heck we could get this into a CI-CD pipeline. So we made a transition, and this transition meant, okay, now we don't want to run stuff in a browser environment, we want to simulate a browser environment in a node-based environment, so we came out with JestDOM, and on top of JestDOM, we had Jest, and we paired it with Enzyme, as a testing library, to write our tests. And this is where we were around 2017, 2018, but in 2018, I think, that's when something changed, and I would like to call it the backend fallacy and the categorization pain, because this is what happened in 2018. The famous tweet that changed the way we did testing in the frontend, in the JavaScript world. The more your tests resemble the way your software is used, the more confidence they can give you.
Comments