
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@rbxts/test-cloud-testez
Advanced tools
Lightweight testing tool for running TestEZ tests in Roblox Cloud and Studio environments with direct API calls, supporting both TypeScript and Lua projects
在 Roblox Cloud 环境中运行 TestEZ 测试的轻量级工具 - 内置 TestEZ,无需外部依赖。
✅ 内置 TestEZ - 无需 Wally 或 @rbxts/testez,TestEZ 源码内置在 TestService/test-cloud-testez/testez/
✅ 改进的错误处理 - require() 错误显示详细的位置信息 (→ Failed at: <location>)
✅ 零外部测试依赖 - 仅使用 Node.js 内置模块
✅ 快速执行 - ~8-15 秒完整测试流程
✅ 详细报告 - YAML 格式,易于阅读和版本控制
✅ 自动测试发现 - 递归扫描 .spec 文件
✅ 支持双项目 - TypeScript 和 Lua 项目通用
npm install test-cloud-testez
# 或
pnpm add test-cloud-testez
创建 .env.roblox 文件:
ROBLOX_API_KEY=<your-api-key> # Roblox Open Cloud API Key
UNIVERSE_ID=<universe-id> # Universe ID
TEST_PLACE_ID=<place-id> # Test Place ID
# 可选:代理配置
HTTPS_PROXY=http://proxy.example.com:8080
TestEZ 源码内置在项目中: TestService/test-cloud-testez/testez/
wally install@rbxts/testez npm 包npm test
npm test -- StringUtils
npm test -- -V
# 或更详细
npm test -- -VV
# 跳过构建步骤
npm test -- --skip-build
# 自定义超时时间(秒)
npm test -- -t 180
# 指定测试根路径
npm test -- --roots ServerScriptService/Server
# 显示帮助信息
npm test -- -h
| 选项 | 描述 | 默认值 |
|---|---|---|
-V, --verbose | 详细输出模式(可多次使用:-VV 最详细) | - |
-t, --timeout <sec> | 任务执行超时时间(秒) | 120 |
-r, --rbxl <path> | 指定 rbxl 文件路径 | test-place.rbxl |
--roots <path> | 测试根路径,用 ; 分隔 | ServerScriptService;ReplicatedStorage |
--glob <match> | 在根路径中匹配测试文件 | - |
--skip-build | 跳过 Rojo 构建步骤 | false |
-h, --help | 显示帮助信息 | - |
-v, --version | 显示版本信息 | - |
测试结果保存在 .test-result/ 目录:
print() 和 warn() 输出(使用 LogService)timestamp: '2025-11-18T04:00:00.000Z'
success: true
totalTests: 58
passed: 58
failed: 0
skipped: 0
errors: []
printMessages:
- message: '🧪 Starting tests...'
type: MessageOutput
timestamp: 1763464834
- message: 'Testing something'
type: MessageOutput
timestamp: 1763464834
- message: 'This is a warning'
type: MessageWarning
timestamp: 1763464834
-- MyModule.spec.lua
return function()
local MyModule = require(script.Parent.MyModule)
describe("MyModule", function()
it("should do something", function()
local result = MyModule.doSomething()
expect(result).to.equal(expected)
end)
end)
end
在云测试环境中,可以直接使用普通的 print() 和 warn() 函数:
return function()
print("🧪 Starting tests...") -- ✅ 会被自动捕获
describe("MyModule", function()
it("should work", function()
print("Testing something") -- ✅ 会被自动捕获
warn("This is a warning") -- ✅ warn 也会被捕获
expect(true).to.equal(true)
end)
end)
print("✅ Tests completed")
end
捕获机制: 使用 LogService.MessageOut 事件自动捕获所有日志消息。
注意: 调试完成后立即移除 print() 语句,避免影响性能。
TestEZ 只提供 5 个核心匹配器:
.to.equal(value) - 检查值是否相等.to.be.near(value, limit?) - 检查数值是否接近(浮点数).to.throw(msg?) - 检查函数是否抛出错误.to.be.a(type) - 检查值类型.to.be.ok() - 检查值是否为 truthy数值比较(没有 .greaterThan()):
expect(score > 100).to.equal(true) -- ✅ 大于
expect(level < 10).to.equal(true) -- ✅ 小于
expect(value >= 0).to.equal(true) -- ✅ 大于等于
当测试中的 require() 发生错误时,会显示详细的位置信息:
改进前:
Requested module experienced an error while loading
ServerScriptService.Server.MyTest.spec:42
改进后:
Requested module experienced an error while loading
→ Failed at: ServerScriptService.Server.MyTest.spec:42
ServerScriptService.Server.MyTest.spec:42
TaskScript:361
详见: TESTEZ_REQUIRE_ERROR_FIX.md
TestEZ 源码内置在 TestService/test-cloud-testez/testez/,带来以下优势:
npm run build 即可A: TestEZ 源码内置在 TestService/test-cloud-testez/testez/,无需安装。不需要 Wally 或 @rbxts/testez。
A: 直接使用 print() 和 warn() 即可,输出会被自动捕获(使用 LogService.MessageOut)。调试完成后立即移除。
A: 已修复!现在会显示具体的错误位置,如 → Failed at: ServerScriptService.Server.MyModule:42
A: .test-result/ 目录,YAML 格式,自动保留最近 2 次结果。
A: 使用 --roots 参数:npm test -- --roots ServerScriptService/Server
A: 传递测试名称作为参数:npm test -- MyModule(不区分大小写)
A: 使用 -t 参数增加超时时间:npm test -- -t 300(300 秒)
A: 支持 TypeScript(roblox-ts)和 Lua 项目。自动检测项目类型。
MIT License
欢迎提交 Issue 和 Pull Request!
由 White Dragon 开发 | Version 0.3.6
FAQs
Lightweight testing tool for running TestEZ tests in Roblox Cloud and Studio environments with direct API calls, supporting both TypeScript and Lua projects
We found that @rbxts/test-cloud-testez demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.