File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,13 @@ This is useful for testing code that needs a request object, such as:
233233* [ Flow objects] ( $root/reference/flows.html )
234234* Methods like ` url_for ` , ` build_url ` , or accessing ` session ` /` cookies `
235235
236+ > ** Note on ` ngx ` availability:** Unlike ` simulate_request ` , which maintains a
237+ > mock ` ngx ` global throughout the request cycle, ` stub_request ` does not
238+ > provide an ` ngx ` global after it returns. The returned request object is
239+ > fully functional on its own, but any code that directly accesses ` ngx.* ` APIs
240+ > will fail. If you need to test code that uses ` ngx ` directly, use
241+ > ` simulate_request ` instead.
242+
236243$dual_code{
237244lua = [[
238245local stub_request = require("lapis.spec.request").stub_request
You can’t perform that action at this time.
0 commit comments