mcpField
J
jest

jest

github.com/christopher-bussTesting & quality872 installsUpdated 4w ago
Repository

About jest

jest is a skill reference for Jest Roblox, a Luau port of Jest for Roblox. It covers the adapted API and its differences from JavaScript Jest, with guidance for testing, mocking, snapshots, and benchmarking.

Key features

  1. 01Explains Luau-specific Jest deviations
  2. 02Covers test structure and matchers
  3. 03Documents async and snapshot testing
  4. 04Describes timer and module mocking
  5. 05Includes benchmark guidance

Use cases

  1. 01Writing Roblox Luau tests
  2. 02Adapting Jest examples to Luau
  3. 03Mocking modules and timers
  4. 04Setting up snapshot tests

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/christopher-buss/skills --skill jest

After installing, type/jestin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

GENERATION.md
references/
advanced-benchmarking.md
core-asymmetric-matchers.md
core-configuration.md
core-deviations.md
core-matchers.md
core-mocking.md
core-test-structure.md
feature-async-testing.md
feature-custom-matchers.md
feature-global-mocks.md
feature-jest-extended.md
feature-module-mocking.md
feature-snapshot-testing.md
feature-test-filtering.md
feature-timer-mocks.md

Details

From the project README

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

Comments

Markdown supported