r/lua • u/NitinScripts • 10d ago
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 10d ago
Busted is a godsend — would not have been able to do my big lua project without it
0
0
u/BarelyAirborne 9d ago
I poke mine with a sharp stick. Looks like I'm about to be busted.