return function()local I=require(script.Parent.NoYield)it("\115\104\111\117\108\100 \099\097\108\108 \102\117\110\099\116\105\111\110\115 \110\111\114\109\097\108\108\121",function()local G=0 local function j(I,j)(expect(I)).to.equal(5);(expect(j)).to.equal(6)G=G+1 return 11,"\104\101\108\108\111"end local x,h=I(j,5,6);(expect(x)).to.equal(11);(expect(h)).to.equal("\104\101\108\108\111")end)it("\115\104\111\117\108\100 \116\104\114\111\119 \111\110 \121\105\101\108\100",function()local G=0 local j=0 local function x()G=G+1 wait()j=j+1 end local h,s=pcall(I,x);(expect(G)).to.equal(1);(expect(j)).to.equal(0);(expect(h)).to.equal(false);(expect(s:find("\065\116\116\101\109\112\116\101\100 \116\111 \121\105\101\108\100 \105\110\115\105\100\101 \099\104\097\110\103\101\100 \101\118\101\110\116\033"))).to.be.ok();(expect(s:find("\078\111\089\105\101\108\100\046\115\112\101\099"))).to.be.ok()end)it("\115\104\111\117\108\100 \112\114\111\112\097\103\097\116\101 \101\114\114\111\114 \109\101\115\115\097\103\101\115",function()local G=0 local function j()G=G+1 error("\102\111\111")end local x,h=pcall(I,j);(expect(x)).to.equal(false);(expect(h:find("\102\111\111"))).to.be.ok();(expect(h:find("\078\111\089\105\101\108\100\046\115\112\101\099"))).to.be.ok()end)end
return function()
	local NoYield = require(script.Parent.NoYield)

	it("should call functions normally", function()
		local callCount = 0

		local function test(a, b)
			expect(a).to.equal(5)
			expect(b).to.equal(6)

			callCount = callCount + 1

			return 11, "hello"
		end

		local a, b = NoYield(test, 5, 6)

		expect(a).to.equal(11)
		expect(b).to.equal("hello")
	end)

	it("should throw on yield", function()
		local preCount = 0
		local postCount = 0

		local function testMethod()
			preCount = preCount + 1
			wait()
			postCount = postCount + 1
		end

		local ok, err = pcall(NoYield, testMethod)

		expect(preCount).to.equal(1)
		expect(postCount).to.equal(0)

		expect(ok).to.equal(false)
		expect(err:find("Attempted to yield inside changed event!")).to.be.ok()
		expect(err:find("NoYield.spec")).to.be.ok()
	end)

	it("should propagate error messages", function()
		local count = 0

		local function test()
			count = count + 1
			error("foo")
		end

		local ok, err = pcall(NoYield, test)

		expect(ok).to.equal(false)
		expect(err:find("foo")).to.be.ok()
		expect(err:find("NoYield.spec")).to.be.ok()
	end)
end
