local d=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local h=require("\064\112\107\103\047\074\101\115\116\071\108\111\098\097\108\115")local c=h.test local W=h.expect local a=require("\046\047\103\101\116\082\111\098\108\111\120\084\115\082\117\110\116\105\109\101")c("\114\101\116\114\105\101\118\101\115 \116\104\101 \114\111\098\108\111\120-\116\115 \114\117\110\116\105\109\101 \108\105\098\114\097\114\121",function()local h=Instance.new("\070\111\108\100\101\114")h.Name="\114\098\120\116\115\095\105\110\099\108\117\100\101"h.Parent=d local c=Instance.new("\077\111\100\117\108\101\083\099\114\105\112\116")c.Name="\082\117\110\116\105\109\101\076\105\098"c.Parent=h local q=a()h:Destroy();(W(q==c)).toBe(true)end)c("\114\101\116\117\114\110\115 \110\105\108 \105\102 \116\104\101 \114\117\110\116\105\109\101 \099\097\110\'\116 \098\101 \102\111\117\110\100",function()local d=a();(W(d)).toBeUndefined()end)
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local JestGlobals = require("@pkg/JestGlobals")
local test = JestGlobals.test
local expect = JestGlobals.expect

local getRobloxTsRuntime = require("./getRobloxTsRuntime")

test("retrieves the roblox-ts runtime library", function()
	local includes = Instance.new("Folder")
	includes.Name = "rbxts_include"
	includes.Parent = ReplicatedStorage

	local mockRuntime = Instance.new("ModuleScript")
	mockRuntime.Name = "RuntimeLib"
	mockRuntime.Parent = includes

	local runtime = getRobloxTsRuntime()

	includes:Destroy()

	expect(runtime == mockRuntime).toBe(true)
end)

test("returns nil if the runtime can't be found", function()
	local runtime = getRobloxTsRuntime()
	expect(runtime).toBeUndefined()
end)
