Leste¶
Leste is a powerful, user-friendly Lua testing framework heavily inspired by PestPHP and pytest, built to simplify and streamline your testing process.
Just like a compass guides you in the right direction, Leste serves as a guiding tool for your tests, ensuring that you stay on the right path to successful testing practices.
The name Leste cleverly merges Lua (L) and teste (Portuguese for test), embodying the playful essence of its creation. Additionally, the word "leste" in Portuguese carries the meaning of "east" — a subtle homage to Lua's Brazilian roots.
Leste can provide visually appealing error reports to streamline your workflow.
Features¶
- Assertion Tracking — Leste tracks the total number of assertions made during tests.
- Ready-Made Assertions — the
leste.assertionsmodule ships common checks (equal,strContains,tableContains, and more) with clear default failure messages. - Test Case Organization — organize setup and teardown logic with
beforeAll,afterAll,beforeEach, andafterEachhooks. - Verbose Output — choose whether to display the output of
print/io.writecalls made inside your tests. - Exit on First Failure — option to stop running tests after the first failure.
- CLI Interface — run your whole suite, a single file, or a specific folder, straight from the command line.
- Flexible Test Case Definition — define test cases with the
itfunction, specifying a description and a test function. - Detailed Test Reports — get test outcomes, execution time, assertion counts, and errors for every test.
- Configurable Output — customize colors and verbosity to fit your terminal and workflow.
- Cross-Platform — works the same way on Linux, macOS, and Windows.
Requirements¶
Leste works with Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT. It has no runtime dependencies beyond a standard Lua installation.
Next Steps¶
- Install Leste with LuaRocks or by cloning the repository.
- Learn the CLI usage — arguments, options, and examples.
- Follow the Writing Tests guide to write your first test suite.
- Browse the Assertions Reference for the full
leste.assertionsAPI.
License¶
Leste is licensed under the MIT License. See the LICENSE file for details.