A minimal, fast test runner for Luau projects with a beautiful CLI interface.
- ⚡ Fast: Minimal overhead, optimized for speed
- 🎨 Beautiful Output: Colored terminal output with progress bars and timing (requires Nerd Fonts)
- 🔍 Smart Discovery: Automatically finds and runs all test files
- 🎯 Focus Mode: Run only specific tests during development
- ⏭️ Skip Tests: Easily skip tests that aren't ready
- 📦 Zero Dependencies: Pure Luau implementation
- 🛠️ Flexible: Multiple ways to define your tests
- Create a test file with
.spec.luauextension:
local run = {}
function run.should_run()
assert(1 + 1 == 2, "Basic math should work")
end
return run- Run your tests:
pesde x ernisto/test -- tests- See the output
Note: For the best experience with special characters and icons, install a Nerd Font for your terminal.
local run, focus, skip = {}, {}, {}
function run.should_skip_this_test()
error('shouldnt run')
end
function focus.should_focus_this_test()
print('debugging here')
end
function skip.should_skip_this_test()
error('shouldnt run')
end
return { run = run, focus = focus, skip = skip, name = 'my_suite' }To use the test helper, you must install the package
pesde install ernisto/test-- tests/example.spec.luau
local test = require('@pkg/test')
local spec, run, focus, skip = test.suite()
function run.should_pass_simple_test()
assert(1 + 1 == 2, "Basic math should work")
end
function run.should_handle_strings()
local result = "hello" .. " " .. "world"
assert(result == "hello world", "String concatenation failed")
end
return spec# Run tests in current directory
pesde x ernisto/test
# Run tests in specific directory
pesde x ernisto/test -- tests/When you have focused tests (tests in the focus table), only those tests will run:
function focus.should_debug_this_specific_issue()
print('debugging here')
end
function run.should_skip_this_test()
error('shouldnt run')
endThis is perfect for debugging specific issues without running the entire test suite.
Use the skip table to temporarily disable tests:
function run.should_run_this_test()
-- test here
end
function skip.should_skip_this_test()
error('shouldnt run')
endyour-project/
├── tests/
│ ├── math.spec.luau
│ ├── strings.spec.luau
│ └── utils.spec.luau
├── src/
│ └── your-code.luau
└── pesde.toml
Contributions are welcome! Please note:
- If you're using VS Code, you might need to enable
.luaufile visibility in your workspace settings - All code should be written in Luau
- Tests should be added for new features
MIT License - see LICENSE for details.