1---2name: jest-43description:4 Testing Roblox/Luau code with Jest Roblox. Use when writing tests, mocking5 functions, asserting values, or configuring test suites in Luau. NOT6 JavaScript Jest — uses .never instead of .not, jest.fn() returns two values,7 0 is truthy.8metadata:9 source: https://skillmd.com/skills/christopher-buss/jest-410 upstream: Generated from https://github.com/Roblox/jest-roblox, scripts located at https://github.com/christopher-buss/skills11 author: Christopher Buss12 version: 2026.2.713---1415> Based on Jest Roblox v3.x, generated 2026-02-07.1617Jest Roblox is a Luau port of Jest for the Roblox platform. It closely follows18the upstream Jest API but has critical deviations due to Luau language19constraints.2021**Critical deviations from JS Jest:**2223- `.never` instead of `.not` (reserved keyword)24- `jest.fn()` returns **two values**: mock object + forwarding function25- `0`, `""`, `{}` are **truthy** in Luau (only `false` and `nil` are falsy)26- All globals (`describe`, `expect`, `jest`, etc.) must be explicitly imported27- `.each` uses table syntax, not tagged template literals28- Custom matchers take `self` as first parameter2930Read [core-deviations](references/core-deviations.md) first when working with31this codebase.3233## Core References3435| Topic | Description | Reference |36| ------------------- | -------------------------------------------------------- | ------------------------------------------------------------------ |37| Deviations | All Luau/Roblox differences from JS Jest | [core-deviations](references/core-deviations.md) |38| Test Structure | describe, test/it, hooks, .each, .only/.skip | [core-test-structure](references/core-test-structure.md) |39| Matchers | toBe, toEqual, toContain, toThrow, mock matchers | [core-matchers](references/core-matchers.md) |40| Asymmetric Matchers | expect.anything/any/nothing/callable, .resolves/.rejects | [core-asymmetric-matchers](references/core-asymmetric-matchers.md) |41| Mocking | jest.fn(), spyOn, mock.calls, return values | [core-mocking](references/core-mocking.md) |42| Configuration | jest.config.lua, runCLI, reporters, options | [core-configuration](references/core-configuration.md) |4344## Features4546### Testing Patterns4748| Topic | Description | Reference |49| --------------- | -------------------------------------------- | ---------------------------------------------------------------- |50| Async Testing | Promises, done callbacks, .resolves/.rejects | [feature-async-testing](references/feature-async-testing.md) |51| Custom Matchers | expect.extend(), self parameter, isNever | [feature-custom-matchers](references/feature-custom-matchers.md) |52| Test Filtering | testMatch, testPathPattern, testNamePattern | [feature-test-filtering](references/feature-test-filtering.md) |5354### Mocking5556| Topic | Description | Reference |57| -------------- | --------------------------------------------- | -------------------------------------------------------------- |58| Timer Mocks | useFakeTimers, Roblox timers, engineFrameTime | [feature-timer-mocks](references/feature-timer-mocks.md) |59| Global Mocks | jest.globalEnv, spyOn globals, library mocks | [feature-global-mocks](references/feature-global-mocks.md) |60| Module Mocking | jest.mock(), isolateModules, resetModules | [feature-module-mocking](references/feature-module-mocking.md) |6162### Advanced6364| Topic | Description | Reference |65| ------------ | ------------------------------------------------ | ------------------------------------------------------------ |66| Benchmarking | benchmark(), Reporter, Profiler, CustomReporters | [advanced-benchmarking](references/advanced-benchmarking.md) |