local K=require(script.Parent.Promisify)local M=require(script.Parent.Promise)return function()local D="\086\097\108\117\101 \109\117\115\116 \098\101 \115\116\114\105\110\103\033"local b=K(function(K)assert(type(K)=="\115\116\114\105\110\103",D)return K:rep(3)end)describe("\087\114\097\112\112\105\110\103 \102\117\110\099\116\105\111\110\115 \105\110 \097 \112\114\111\109\105\115\101",function()it("\115\104\111\117\108\100 \104\097\110\100\108\101 \119\114\097\112\112\105\110\103 \097 \102\117\110\099\116\105\111\110 \105\110 \097 \112\114\111\109\105\115\101",function()local K=b("\084\101\115\116");(expect(M.is(K))).to.equal(true)local D,a=K:await();(expect(D)).to.equal(true);(expect(a)).to.equal("\084\101\115\116\084\101\115\116\084\101\115\116")local U=b(10)local Z=U:await();(expect(Z)).to.equal(false)end)end)end
local Promisify = require(script.Parent.Promisify)
local Promise = require(script.Parent.Promise)
return function()
	local ERR = "Value must be string!"
	local myFunctionAsync =
		Promisify(
		function(value)
			assert(type(value) == "string", ERR)
			return value:rep(3)
		end
	)

	describe(
		"Wrapping functions in a promise",
		function()
			it(
				"should handle wrapping a function in a promise",
				function()
					local callTest = myFunctionAsync("Test")
					expect(Promise.is(callTest)).to.equal(true)

					local success, result = callTest:await() -- use await because can't test with :andThen( )
					expect(success).to.equal(true)
					expect(result).to.equal("TestTestTest")

					local callTest2 = myFunctionAsync(10)
					local success2 = callTest2:await()
					expect(success2).to.equal(false)
				end
			)
		end
	)
end
