Skip to content
0:00 / 0:00

#jest#testing#nodevm

Jest Architecture

Nakazawa Tech

1.6K subscribers • 1 video on Hallway

YouTube
  • Recommended by 2 people: 1 in engineering communities and 1 on Stack Overflow and its sister sites.
  • Presented by Christoph Nakazawa, Rick Hanlon II and Rubén Norte
  • May be out of date. Uploaded 7 years ago, in an area where tools change fast.

Advanced. Deep dive for people who know the field.

28K views7 years ago2 recommendations

Tools and practiceWeb developmentTestingNode.js, Deno and Bun

Christoph Nakazawa, Rick Hanlon II, and Rubén Norte explain the internal architecture of Jest, including how it runs tests and mocks modules.

This overview by Christoph Nakazawa, Rick Hanlon II and Rubén Norte explains the basic architecture of Jest and what it takes to run a single test. Let us know if there are other things you'd like us to explore and talk about next or if you have any questions!

Why it's here

2 people recommend this

What people say. Engineers point to this video to explain how Jest uses Node.js VM functionality and require interception to mock modules.

Moments people linked to

Denis Obydennykhon Stack Overflow • Recommends

On “What is happening under the hood that allows jest to mock a function that is called from outside the test file?”

Jest utilizes nodejs vm functionality, that allows to control and modify code execution https://nodejs.org/api/vm.html That is done in jest-runtime package https://github.com/facebook/jest/blob/46c9c13811ca20a887e2826c03852f2ccdebda7a/packages/jest-runtime/src/index.ts#L531 You can see detailed description in this video describing jest architecture jest-runtime && node vm link to this video require interception link to this video
11View the answer

u/fagnerbrackin r/Frontend • Recommends

Jest Architecture Overview