jest

Testing Roblox/Luau code with Jest Roblox. Use when writing tests, mocking functions, asserting values, or configuring test suites in Luau with Jest Roblox. NOT JavaScript Jest — uses .never instead of .not, jest.fn() returns two values, 0 is truthy.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "jest" with this command: npx skills add christopher-buss/skills/christopher-buss-skills-jest

Based on Jest Roblox v3.x, generated 2026-02-07.

Jest Roblox is a Luau port of Jest for the Roblox platform. It closely follows the upstream Jest API but has critical deviations due to Luau language constraints.

Critical deviations from JS Jest:

  • .never instead of .not (reserved keyword)
  • jest.fn() returns two values: mock object + forwarding function
  • 0, "", {} are truthy in Luau (only false and nil are falsy)
  • All globals (describe, expect, jest, etc.) must be explicitly imported
  • .each uses table syntax, not tagged template literals
  • Custom matchers take self as first parameter

Read core-deviations first when working with this codebase.

Core References

TopicDescriptionReference
DeviationsAll Luau/Roblox differences from JS Jestcore-deviations
Test Structuredescribe, test/it, hooks, .each, .only/.skipcore-test-structure
MatcherstoBe, toEqual, toContain, toThrow, mock matcherscore-matchers
Asymmetric Matchersexpect.anything/any/nothing/callable, .resolves/.rejectscore-asymmetric-matchers
Mockingjest.fn(), spyOn, mock.calls, return valuescore-mocking
Configurationjest.config.lua, runCLI, reporters, optionscore-configuration

Features

Testing Patterns

TopicDescriptionReference
Async TestingPromises, done callbacks, .resolves/.rejectsfeature-async-testing
Custom Matchersexpect.extend(), self parameter, isNeverfeature-custom-matchers
Snapshot TestingtoMatchSnapshot, property matchers, serializersfeature-snapshot-testing
Test FilteringtestMatch, testPathPattern, testNamePatternfeature-test-filtering

Mocking

TopicDescriptionReference
Timer MocksuseFakeTimers, Roblox timers, engineFrameTimefeature-timer-mocks
Global Mocksjest.globalEnv, spyOn globals, library mocksfeature-global-mocks
Module Mockingjest.mock(), isolateModules, resetModulesfeature-module-mocking

Extended Matchers

TopicDescriptionReference
Jest ExtendedWhen core matchers aren't expressive enough: exact booleans, ranges, membership, entries, call order, side effectsfeature-jest-extended

Advanced

TopicDescriptionReference
Benchmarkingbenchmark(), Reporter, Profiler, CustomReportersadvanced-benchmarking

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

test-driven-development

No summary provided by upstream source.

Repository SourceNeeds Review
General

jest

No summary provided by upstream source.

Repository SourceNeeds Review
General

roblox-ts

No summary provided by upstream source.

Repository SourceNeeds Review
General

humanizer

No summary provided by upstream source.

Repository SourceNeeds Review