Jest Study Notes
Everything on SkillVeris tagged Jest Study Notes — collected across the glossary, study notes, blog, and cheat sheets.
30 resources across 1 library
Study Notes(30)
Testing Async Code: Promises and async/await
Learn the correct patterns for testing promise-based and async/await code in Jest, and the pitfalls that let async bugs slip past a green test run.
beforeAll() and afterAll()
Understand how Jest's beforeAll() and afterAll() hooks handle one-time, expensive setup and teardown shared across an entire test suite.
beforeEach() and afterEach()
Learn how Jest's beforeEach() and afterEach() hooks establish and tear down consistent test state so every test runs in isolation.
Code Coverage with Jest
Understand how Jest measures code coverage across statements, branches, functions, and lines, and how to enforce thresholds in CI.
Common Matchers: toBe, toEqual, toContain
Learn how Jest's core matchers toBe, toEqual, and toContain compare values, objects, and collections, and when to reach for each one.
Writing Custom Matchers
Learn how to extend Jest's expect with expect.extend() to write custom matchers that produce clearer, more expressive assertions and failure messages.
Installing and Configuring Jest
How to add Jest to a JavaScript or TypeScript project, and the key configuration options in jest.config.js.
Jest Best Practices
Practical guidelines for writing fast, reliable, and maintainable Jest test suites that catch real bugs without becoming brittle.
Jest Configuration: Multi-Project Setups
Learn how to configure Jest's projects array to run multiple test environments and configurations, like unit and integration suites, from a single Jest invocat…
Jest in CI/CD Pipelines
How to configure Jest to run reliably, quickly, and with useful reporting inside continuous integration pipelines.
Jest in Monorepos
Learn how to configure Jest to run efficiently across multiple packages in a monorepo, covering shared config, workspace-aware discovery, and CI caching.
Jest Interview Questions
Common Jest interview topics covering mocks, async testing, fake timers, and module mocking, with the reasoning behind each answer.
Jest Quick Reference
A condensed cheat sheet of essential Jest CLI flags, matchers, lifecycle hooks, and config keys for day-to-day use.
Jest vs Vitest vs Mocha
How Jest compares to Vitest and Mocha in philosophy, speed, and ecosystem so you can pick the right test runner.
Mock Functions with jest.fn()
Learn how to create, configure, and inspect Jest mock functions to isolate units under test and verify how dependencies are called.
Mocking HTTP Requests
Learn how to mock network calls in Jest tests using axios/fetch stubs, interceptor libraries like nock and msw, and how to simulate error and timeout scenarios.
Mocking Modules with jest.mock()
Understand how jest.mock() replaces entire modules with automatic or manual mocks, and how to combine that with jest.requireActual for partial mocking.
Mocking Timers
Learn how to use Jest's fake timers to control setTimeout, setInterval, and Date deterministically instead of waiting on real wall-clock time in tests.
Parameterized Tests with test.each()
Learn how to use Jest's test.each() and describe.each() to run the same test logic against multiple input/output pairs without duplicating code.
Running and Watching Tests
How to run Jest from the command line, use watch mode for fast feedback, and interpret coverage output.
Snapshot Testing
Understand how Jest's snapshot testing captures serialized output over time, when it's a good fit, and how to manage snapshot files responsibly.
Spying on Functions with jest.spyOn()
Learn how jest.spyOn() wraps real methods to track and optionally override their behavior, and how it differs from a plain jest.fn() mock.
test() and describe() Blocks
How to organize related tests using describe() blocks, and the setup/teardown hooks that run alongside them.
Test Fixtures and Factories
Learn how to build reusable test fixtures and factory functions to generate consistent, customizable test data across a Jest suite.
Showing 24 of 30.