rbxts-tester
v0.1.0
Published
CLI test runner for roblox-ts packages — runs compiled .test.luau files via Lune
Maintainers
Readme
rbxts-tester
CLI test runner for roblox-ts packages. Runs compiled .test.luau files using Lune — no Roblox Studio needed.
Installation
npm install -g rbxts-testerOr run directly with npx:
npx rbxts-tester .Usage
# Run tests in the current directory
rbxts-tester .
# Run tests in a specific project
rbxts-tester ./my-roblox-ts-lib
# Run tests with a relative path
rbxts-tester ../other-packageThe project directory must contain:
tsconfig.jsonwithcompilerOptions.outDirset- Compiled
.test.luaufiles in theoutDir
How It Works
- Reads
tsconfig.jsonto findoutDir - Builds a virtual Roblox Instance tree from compiled
.luaufiles - Lazily detects and mounts
node_modules/@rbxtspackages - Loads the real roblox-ts
RuntimeLib.luaforTS.import,TS.getModule, etc. - Runs each
.test.luaufile with a jest-like test framework (test,expect,testInit,runTests)
Writing Tests
// src/tests/my.test.ts
import { test, expect, testInit, runTests } from "../test";
import { myFunction } from "../myModule";
testInit(() => {
print("Setting up...");
});
test("myFunction adds numbers", () => {
expect(myFunction(2, 3)).toBe(5);
});
runTests();Supported Packages
- Packages with root
init.luau(e.g.@rbxts/charm,@rbxts/services) - Packages with
out/init.luau(e.g.@rbxts/zlib,@rbxts/base64)
Platform Support
- Linux (x86_64, aarch64)
- macOS (x86_64, aarch64)
- Windows (x86_64, aarch64)
License
MIT
