Testing lib.wezterm
April 5, 2025 ยท View on GitHub
This directory contains tests for the lib.wezterm library.
Running Tests
Prerequisites
- Lua 5.4
- LuaRocks
- Busted (testing framework)
Install Dependencies
luarocks install busted
luarocks install luacov
Run Tests
From the root of the repository:
cd tests
busted
Or to run with coverage:
cd tests
busted -c
luacov
Test Structure
*_spec.luafiles contain tests for each modulemocks/directory contains mock implementations of external dependenciestest_helper.luacontains test setup utilities
Adding New Tests
When adding new functionality to the library, please add corresponding tests:
- If you've added a new module, create a new
module_name_spec.luafile - For new functions in existing modules, add test cases to the corresponding spec file
- When needed, update mocks in the
mocks/directory
Continuous Integration
Tests are automatically run on GitHub Actions when:
- Code is pushed to the main branch
- A pull request is opened against the main branch
See .github/workflows/test.yml for details.