r/lua • u/NitinScripts • Sep 27 '26
you're writing Lua without tests, try Busted
Just want to shout out the busted library.
I've been using it on my recent Lua projects and honestly, why didn't I start earlier?
Install: luarocks install busted
Run: busted in your project dir
It just works. describe("my feature", function() it("should do x", function() assert.is_true(true) end) end)
Mocks and spies are built-in, no extra libs needed.
If you are still doing print() debugging, do yourself a favor and try it. What's your go-to testing setup for Lua?
6
Upvotes
0
u/H4ns3mand Sep 27 '26
Busted is a godsend — would not have been able to do my big lua project without it
0
u/BarelyAirborne Sep 27 '26
I poke mine with a sharp stick. Looks like I'm about to be busted.
0
u/VidaOnce Sep 27 '26
The humble
lde test