Meta’s JavaScript Testing Framework Joins OpenJS – The New Stack

After releasing an update to its JavaScript testing framework, Jest, Meta announced that it would be transitioning the technology to the OpenJS foundation.

I spoke with Rick Hanlon, a frontend engineer at Meta and a member of the React core team, on Jest’s growth in the project we see today and its move to OpenJS. Hanlon was a core contributor to Jest before working for Meta, which allowed him to see the project grow both internally and externally.

“In 2014, Jest officially went open source,” he said. “From there to around 2016, the engineers worked part-time until they decided to build a team around him. Christopher Nakazawa, who worked for Meta at the time and is still a core Jest contributor, completely revamped it. He and his team created most of the features that people really know Jest for today, such as watch mode, error messaging, error reporting, and the massive testing experience.

Hanlon continued, “This work lasted until 2018 when I got involved in the project. Right from the start, not just with Jest but with previous languages ​​we’ve built, there was an internal philosophy that if you’re building something that can be valuable to the community, then it should be open source.

How .jst evolved into Jest

Jest is the latest version of a framework developed over ten years ago. In the old days, when Meta was still Facebook and was busy tweaking its messaging service, .jst was only used internally. Hanlon explained how Jest went from an in-house language to an open source project.

“Although .jst was designed for our messaging platform in 2011,” he explained, “it quickly morphed into something else over the years. We really needed high performance testing, between others, and it went from there. Since it wasn’t directly related to Facebook, it was a great candidate for open source. Plus, it was super useful for testing React apps, and Facebook was just coming to open React at this time.

Three years later, Jest made its open source debut and quickly gained contributors and a bubbling community. In 2018, the Jest Open Collective was formed and began raising funds for developers outside of Meta to contribute to the project. To date, nearly $80,000 has been raised for the Jest community.

“Cristoph and Meta set up the Open Collective as a way to sponsor non-Meta employees,” Hanlon said. “Meta themselves have over the years contributed at least $22,000 directly to the fund. They supported open source maintainers and allowed us to fund meetups where contributors can come together and socialize, which was great.

I asked Hanlon why Jest became so much more dynamic after launching the Open Collective, and his answer was simple. More developers and more funds equaled a significant improvement in functionality for the already popular Jest, including online snapshots and ESM support.

Simplified tests

Jest’s tagline promises “delicious” testing. During our interview, I asked Hanlon to give us an in-depth look at what Jest offers that makes it such a dev delight.

“I think there are a lot of things that make it delicious,” he replied. “I can talk about what blew my mind when I first saw Jest – and first and foremost was the performance. It just performed way better than anything else out there. Second, watch mode. Just being able to automatically run your test when you change your code without having to switch and run them again. It constantly monitors file changes and automatically runs tests that only affect changed files. It’s amazing for developer speed improvement. Finally, reports — it’s clear when things fail and when things pass, what tests are running. We put a lot of effort into really clear error messages so developers don’t spend unnecessary time decoding them just to fix a problem.

Hanlon went on to say, “The zero configuration is also a great point. It can be tricky to set everything up, get started, figure out which test files are which, etc. The “out of the box” experience works great. The other thing is [that] Jest is consistent from project to project. You can do a lot of customization, but it kind of forces standardization across the project. So if you get into two different projects that use Jest, you usually figure out what’s going on pretty much and can start contributing very quickly. »

The OpenJS Foundation

Moving Jest to the OpenJS Foundation is a step in the right direction for the open source community, says Hanlon. “This move will primarily be an organizational move. And with that, what it’s going to be able to allow us to do is grow outside of Meta and be able to increase those numbers. Which in turn will allow us to create more features. Additionally, it will allow us to bring people who have never contributed to open source before to contribute.

The OpenJS Foundation is home to a host of JavaScript staples, including Node.js and jQuery. Like all projects when first absorbed by OpenJS, Jest is in the incubation phase and undergoes an integration checklist. Once the OpenJS onboarding process is complete, Jest will end up in the Impact or At-Large Stage project.

According to Hanlon, the transition will allow the Jest community to improve their skills and increase their numbers. Open source projects are made by the community, for the community, and he says Jest is no different.

“I think one of the most satisfying things for me when working on some of these big open source projects is just being able to meet people who are new to open source and help them submit their first changes, or respond to questions and being able to support them and invite them into the community and help them in their careers,” he said. “You’ll meet people who are new to programming or have been programming for a long time, and that’s is just a really good opportunity to be able to meet a lot of like-minded people.”

Finally, he noted that Meta’s open source team has been very helpful in the process of transitioning to OpenJS.

“It’s great because we have a full team supporting us, which makes it easy for us to contribute to open source,” he said, “but we also have very different specialist communities within each project. What’s been great about Jest is that we’ve been able to build this community around Jest, and eventually they [the community] somehow just took off on its own.

Main image via Shutterstock.

Comments are closed.