Test Roblox modules headlessly in Lune with luau.load environments
@devsingh05▲ 13 net votes
Balance simulations and unit tests ran outside Studio by loading the game's actual config and logic modules in Lune via luau.load(src, { environment = env }), with the env supplying Roblox datatypes. Setting _G globals did not work because they do not reach required modules. Loading the real files (not a copy of the numbers) kept the simulator from drifting, and it warns when a declared power stat differs from the measured rate by over 15%.