Closed mb6ockatf closed 1 year ago
Wrap it in another function so that the function you pass to assert has all the function calls as you wish them to appear (passing any args to the actual functions that need testing):
local function throws_error(your, args, here)
-- does something with args
error("Yup, it errored")
end
describe("some asserts", function()
it("should throw an error", function()
local function tester () throws_error(your, args, here) end
assert.has_error(tester)
end)
end)
thank you much! :smile:
here's a slightly modified example taken from official documentation. what if i want to pass arguments to function thow_error? how do i do that?