I still remember how much everyone at Facebook hated Jest back then. It was awesome when it launched, but the JavaScript ecosystem moved so fast – and engineers working on it moved on so quickly as well – that it kept falling behind, and there was nobody who wanted to fix it.
When my manager asked me to work on it, I refused initially. I did eventually explore the codebase and make a few initial fixes, after which I realized: There are a few thousand engineers here, code quality and production bugs are becoming a massive problem, and somehow nobody is working on this. It ended up being a massive opportunity!
I initially focused on making Jest good for Facebook. That meant actually providing great testing APIs and improving Jest’s performance. It was so bad that it was actually possible to make Jest 100x faster! (When somebody makes software more than ~5x faster, it usually means the existing implementation was bad, not that the new solution is so amazing.)
Another advantage of working on a testing framework over other developer tooling is that you can usually just run the full test suite to see if your changes are working or not. This made me - and a bunch of other folks I was able to recruit from across the company - feel like we were moving super fast!
Next, I turned my attention to open source. There were several serious JavaScript test frameworks in the community by this time, and each of them had one or two standout features that were better than their counterparts in Jest. While I felt that Jest wasn’t good enough yet, it was definitely close. One major gap was the initial setup: At Facebook, Jest only had to be set up once, by the JS Infra team. Every other engineer could simply write tests. In open source, the story was different because even though the framework was great, few people knew how to set it up correctly.
create-react-app was starting to become popular, and it didn’t yet come with a testing framework. At the same time, Dan Abramov and I spent a few nights in London hacking on Jest together. Some folks contributed Mocha as a default, and Dan wanted me to add Jest for comparison. I honestly didn’t even consider creating a PR like this - he literally had to drag me to do it. Understandably, this led to a lot of pushback and gave me the greatest opportunity of all time to change the perception of Jest, in PR #250: https://github.com/react/create-react-app/pull/250#issuecomment-237098619
This led Jest to become the most popular testing framework for almost a decade. And while it is no longer the most used testing framework (as it was a testing framework for a different era), it still has about 46 million downloads a week!
It was a lot of hard work to get there: Jest had to be good, fast, stable and feature-rich. But what I learned most is that defaults matter.