roblox-testing
TestEZ, mocking Roblox services, dependency injection, CI/CD with Lune, test patterns.
How do I install this agent skill?
npx skills add https://github.com/tabooharmony/roblox-brain --skill roblox-testingIs this agent skill safe to install?
- Gen Agent Trust Hubfail
This skill provides guidance on Roblox testing patterns but includes a highly risky remote code execution pattern. Specifically, it recommends a CI/CD setup that downloads a shell script from a personal GitHub repository and pipes it directly into the shell for execution, which could allow for the execution of unverified or malicious code.
- Socketpass
No alerts
- Snykfail
Risk: CRITICAL · 2 issues
What does this agent skill do?
When to Load
Load when writing unit/integration tests, mocking Roblox services, setting up CI/CD with Lune, or refactoring code for testability via dependency injection. Hand off to roblox-luau-core for syntax, roblox-luau-types for type design, roblox-luau-patterns for architecture, roblox-security for validation.
Quick Reference
TestEZ (BDD framework)
- Install:
[dev-dependencies] TestEZ = "roblox/testez@0.4.1"inwally.toml - Files:
*.spec.luau, co-located with source - Blocks:
describe→it→beforeEach/afterEach - Assertions:
expect(x).to.equal(y),.to.be.near(n, ε),.to.throw()
Dependency Injection
-- BAD: untestable outside Studio
local store = game:GetService("DataStoreService"):GetDataStore("PlayerData")
-- GOOD: inject dependency
local function saveData(player, data, dataStore)
dataStore:SetAsync("player_" .. player.UserId, data)
end
-- Module init pattern:
function Manager.init(dataStoreService)
_dss = dataStoreService or game:GetService("DataStoreService")
end
Mocking Essentials
-- MockDataStore: in-memory Get/Set/Update
local M = {}
function M.new() return setmetatable({_data={}}, {__index=M}) end
function M:GetAsync(k) return self._data[k] end
function M:SetAsync(k,v) self._data[k]=v end
function M:GetDataStore() return self end
-- MockRemoteEvent: OnServerEvent + FireServer
-- MockSignal: Connect/Fire with Connected flag
CI/CD with Lune
# aftman.toml
[tools]
lune = "lune-org/lune@0.8.0"
Pipeline: selene src/ → stylua --check src/ → luau-lsp analyze → lune run tests/run.luau
-- tests/run.luau
local TestEZ = require("@testez")
local results = TestEZ.TestBootstrap:run({game:GetService("ReplicatedStorage")}, TestEZ.Reporters.TextReporter)
if results.failureCount > 0 then os.exit(1) end
Testing Priority
- DataStore save/load round-trips (prevents data loss)
- Monetization ProcessReceipt (idempotency)
- Core math (damage, buffs, economy)
- Server validation (remote exploits)
Pitfalls
beforeEachto reset state; nevergame:GetService()in logic- Tests must be order-independent; CI needs mocks; commit
wally.lockNeed more detail? Loadreferences/full.mdfor the complete reference with code examples, API tables, and edge cases.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/tabooharmony/roblox-brain/roblox-testing">View roblox-testing on skillZs</a>