Skip to content

Leste

Leste - Your Powerful Lua Test Framework

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.

output of Leste cli
Leste can provide visually appealing error reports to streamline your workflow.

Features

  1. Assertion Tracking — Leste tracks the total number of assertions made during tests.
  2. Ready-Made Assertions — the leste.assertions module ships common checks (equal, strContains, tableContains, and more) with clear default failure messages.
  3. Test Case Organization — organize setup and teardown logic with beforeAll, afterAll, beforeEach, and afterEach hooks.
  4. Verbose Output — choose whether to display the output of print/io.write calls made inside your tests.
  5. Exit on First Failure — option to stop running tests after the first failure.
  6. CLI Interface — run your whole suite, a single file, or a specific folder, straight from the command line.
  7. Flexible Test Case Definition — define test cases with the it function, specifying a description and a test function.
  8. Detailed Test Reports — get test outcomes, execution time, assertion counts, and errors for every test.
  9. Configurable Output — customize colors and verbosity to fit your terminal and workflow.
  10. 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

License

Leste is licensed under the MIT License. See the LICENSE file for details.