Function: setupLuaGlobals()
ts
function setupLuaGlobals(): void;Inject the Lua standard-library globals that X-Ray script code relies on (string, table, math, debug, LuaTable, $range, error, and related helpers) onto globalThis, backed by xray16/mocks.
Call once per test file. A Jest setupFiles entry is the usual place, and createJestConfig wires it there automatically. Re-invoking is safe (it just re-assigns the globals).
xray16/mocks is required lazily so importing the xray16/testing barrel from a Jest config file does not load the Jest-only mock graph. This function itself must run in a Jest environment because it uses the ambient jest global.
Returns
void