DEV.co
Open-Source Testing · lunarmodules

busted

Busted is a lightweight Lua unit testing framework designed for simplicity and readability. It supports modern Lua versions (5.1+), includes mocks and spies for functional testing, and offers multiple output formats including JSON and TAP for CI integration.

Source: GitHub — github.com/lunarmodules/busted
1.6k
GitHub stars
205
Forks
Lua
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorylunarmodules/busted
Ownerlunarmodules
Primary languageLua
LicenseMIT — OSI-approved
Stars1.6k
Forks205
Open issues67
Latest releasev2.3.0 (2026-01-07)
Last updated2026-03-19
Sourcehttps://github.com/lunarmodules/busted

What busted is

Busted provides a BDD-style testing DSL with chainable assertions, spy/mock capabilities, and modular output adapters. It runs on Lua >= 5.1, LuaJIT >= 2.0.0, and MoonScript, with distribution via LuaRocks and Docker containers for isolated execution.

Quickstart

Get the busted source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/lunarmodules/busted.gitcd busted# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Small to medium Lua libraries and pure Lua projects

Ideal for projects with minimal external dependencies. The framework's straightforward DSL and LuaRocks distribution make it the natural choice for Lua-only codebases seeking rapid test setup.

CI/CD pipeline integration for Lua applications

Native TAP output, JSON support, and GitHub Actions integration enable seamless CI workflows. Docker containers provide isolated test environments without dependency pollution.

Projects requiring functional testing with mocks and spies

Busted's built-in spy and mock support simplifies isolation testing. The chainable assertion API supports complex test scenarios without external spy libraries.

Implementation considerations

  • Install via LuaRocks (`luarocks install busted`) or build Docker image; MoonScript dependency required for core testing but optional for end users.
  • Test specs use `describe` and `it` blocks; assertion chaining (e.g., `assert.is_not.equal`) requires learning DSL conventions.
  • Spy/mock setup requires explicit module imports and `spy.on()` calls; no automatic isolation between tests—state management is manual.
  • Output format selection via CLI flags; JSON streaming and TAP formats are production-ready but require format-specific parsing downstream.
  • Docker execution useful for isolation but adds container startup latency; recommended for CI, not local development iteration.

When to avoid it — and what to weigh

  • Lua applications with complex system dependencies — Docker support is limited for projects requiring system libraries or external C modules. Manual dependency management inside containers adds overhead.
  • Performance-critical testing at extreme scale — No documented benchmarks or optimizations for very large test suites. Framework overhead characteristics unknown for 10,000+ test scenarios.
  • You need enterprise-grade test reporting and analytics — Output formats are standard (TAP, JSON, plain text). Custom reporting integrations or metrics dashboards require custom development.
  • Non-Lua test ecosystems requiring language polyglot testing — Framework is Lua-specific. Integration with polyglot test runners or multi-language CI environments requires custom orchestration.

License & commercial use

MIT License (2012–2020 Olivine Labs, LLC). Permissive OSI-approved license permitting commercial use, modification, and redistribution with attribution.

MIT license permits commercial use without restriction. No proprietary or copyleft obligations. Suitable for closed-source and open-source projects alike. Verify any dependency licenses (e.g., MoonScript) for your specific use case.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Security posture not explicitly documented. Standard concerns: test code has access to application internals (by design); spy/mock APIs can be misused to leak sensitive data in test logs. No published security advisories found in provided data. Review dependencies (MoonScript) for known CVEs before production use. Docker images based on Alpine Linux; inherited supply-chain considerations apply.

Alternatives to consider

pytest (Python) / Jest (JavaScript)

Language-specific alternatives with larger ecosystems and IDE integration. Consider if Lua is not your primary language or if you need polyglot testing.

Lua-native: lunit, cwtest

Simpler, minimal-dependency Lua testing frameworks. Choose if busted's DSL overhead is unwanted or if you need extreme lightweight testing.

Commercial test platforms (TestRail, Zephyr)

Enterprise test management with reporting dashboards, traceability, and team collaboration. Choose if regulatory compliance or formal test documentation required.

Software development agency

Build on busted with DEV.co software developers

Start with `luarocks install busted` or pull the Docker image from GitHub Container Registry. See the official docs at lunarmodules.github.io/busted for examples and advanced patterns.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

busted FAQ

Can I run Busted in CI without Docker?
Yes. Install via `luarocks install busted` in your CI environment and invoke `busted` command. Docker is optional; native install is lighter and faster for simple Lua projects.
Does Busted support parallel test execution?
Not clearly stated in provided documentation. Requires review of release notes or issue tracker. Sequential execution is typical; parallelization may require custom CI orchestration.
How do I integrate Busted output into my monitoring/alerting stack?
Use JSON or TAP output formats and parse downstream. JSON with streaming support allows real-time ingestion; TAP is widely supported by CI servers and log aggregators.
Is Busted suitable for embedded Lua or game development?
Yes for game engines with Lua scripting (e.g., Roblox, Love 2D). No support for resource-constrained embedded systems; Lua VM overhead and test framework size may be prohibitive.

Custom software development services

DEV.co helps companies turn open-source tools like busted into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source testing stack.

Ready to adopt Busted for your Lua projects?

Start with `luarocks install busted` or pull the Docker image from GitHub Container Registry. See the official docs at lunarmodules.github.io/busted for examples and advanced patterns.