local d=require("\064\112\107\103\047\074\101\115\116\071\108\111\098\097\108\115")local h=d.test local c=d.expect local W=require("\046\047\103\101\116\069\110\118")h("\114\101\116\117\114\110\115 \097 \116\097\098\108\101",function()(c(typeof(W()))).toBe("\116\097\098\108\101")end)h("\104\097\115 \116\104\101 \099\111\114\114\101\099\116 \'\115\099\114\105\112\116\' \103\108\111\098\097\108",function()local d=W(script.Parent.getEnv);(c(d.script)).toBe(script.Parent.getEnv)end)h("\115\101\116\115 \095\071 \116\111 \116\104\101 \'\103\108\111\098\097\108\115\' \097\114\103\117\109\101\110\116",function()local d={}local h=W(script.Parent.getEnv,d);(c(h._G)).toBeDefined();(c(h._G)).toBe(d);(c(h._G)).never.toBe(_G)end)
local JestGlobals = require("@pkg/JestGlobals")
local test = JestGlobals.test
local expect = JestGlobals.expect

local getEnv = require("./getEnv")

test("returns a table", function()
	expect(typeof(getEnv())).toBe("table")
end)

test("has the correct 'script' global", function()
	local env = getEnv(script.Parent.getEnv)
	expect(env.script).toBe(script.Parent.getEnv)
end)

test("sets _G to the 'globals' argument", function()
	local globals = {}
	local env = getEnv(script.Parent.getEnv, globals)

	expect(env._G).toBeDefined()
	expect(env._G).toBe(globals)
	-- selene: allow(global_usage)
	expect(env._G).never.toBe(_G)
end)
