How can I mock the ngx object and test my Lua files?
For example, let's say I have
-- file.lua
function computeUpstream()
-- advanced calculations!
return theCalculatedUpstream
end
ngx.var.upstream = computeUpstream()
And I want to test this file. How do I do that?