Jest Roblox is a Roblox port of Jest v27.4.7, the open source JavaScript testing framework.
Jest Roblox can run within Roblox itself, including via Roblox's OCALE (Open Cloud API for Luau Execution) for testing on CI systems.
We use Jest Roblox at Roblox for testing our apps, in-game core scripts, built-in Roblox Studio plugins, as well as libraries like Roact Navigation.
Add the packages you need to your wally.toml's dev-dependencies:
[dev-dependencies]
Jest = "roblox/jest@=3.20.0"
JestGlobals = "roblox/jest-globals@=3.20.0"Then run wally install. See wally.run/package/roblox/jest and its siblings for the full set — Jest Roblox publishes 34 modules under the roblox/* scope, one per package in src/.
Install Jest Roblox directly from the Creator Store and drag the resulting rbxm into your project.
Internal
Add the packages you need to your rotriever.toml's dev-dependencies:
[dev_dependencies]
Jest = "3.20.0"
JestGlobals = "3.20.0"Then run rotrieve install.
Author test suites as .spec.lua (or .spec.luau) files under any __tests__/ directory in your project:
local JestGlobals = require(Packages.JestGlobals)
local describe = JestGlobals.describe
local it = JestGlobals.it
local expect = JestGlobals.expect
describe("addition", function()
it("adds two numbers", function()
expect(1 + 1).toBe(2)
end)
end)See the documentation site for the full matcher API, mocking, snapshots, and configuration.
Contributions are welcome! See CONTRIBUTING.md for information.
Jest Roblox is available under the MIT license. See LICENSE for details.