local L=script.Parent.Parent.Parent.Parent local u=require(L.LuauPolyfill)local b=u.Array local M=require(L.JestGlobals)local F=M.expect local t=M.describe local v=M.test local J=game:GetService("\072\116\116\112\083\101\114\118\105\099\101")local d=require(L.Chalk)local r=require(script.Parent.Parent["\115\116\114\105\112-\097\110\115\105"])local w=require(script.Parent.Parent["\098\097\098\101\108-\099\111\100\101-\102\114\097\109\101"])local z=w.default local K=w.codeFrameColumns local e=z t("\064\098\097\098\101\108\047\099\111\100\101-\102\114\097\109\101",function()v("\098\097\115\105\099 \117\115\097\103\101",function()local L=b.join({"\099\108\097\115\115 \070\111\111 \123";"  \099\111\110\115\116\114\117\099\116\111\114\040\041","\125\059"},"\n");(F(e(L,2,16))).toEqual(b.join({"  \049 \124 \099\108\097\115\115 \070\111\111 \123","\062 \050 \124   \099\111\110\115\116\114\117\099\116\111\114\040\041";"    \124                \094";"  \051 \124 \125\059"},"\n"))end)v("\111\112\116\105\111\110\097\108 \099\111\108\117\109\110 \110\117\109\098\101\114",function()local L=b.join({"\099\108\097\115\115 \070\111\111 \123","  \099\111\110\115\116\114\117\099\116\111\114\040\041","\125\059"},"\n");(F(e(L,2,nil))).toEqual(b.join({"  \049 \124 \099\108\097\115\115 \070\111\111 \123","\062 \050 \124   \099\111\110\115\116\114\117\099\116\111\114\040\041";"  \051 \124 \125\059"},"\n"))end)v("\109\097\120\105\109\117\109 \099\111\110\116\101\120\116 \108\105\110\101\115 \097\110\100 \112\097\100\100\105\110\103",function()local L=b.join({"\047\042\042"," \042 \083\117\109\115 \116\119\111 \110\117\109\098\101\114\115\046";" \042"," \042 \064\112\097\114\097\109 \097 \078\117\109\098\101\114"," \042 \064\112\097\114\097\109 \098 \078\117\109\098\101\114"," \042 \064\114\101\116\117\114\110\115 \078\117\109\098\101\114"," \042\047";"","\102\117\110\099\116\105\111\110 \115\117\109\040\097\044 \098\041 \123","  \114\101\116\117\114\110 \097 \043 \098","\125"},"\n");(F(e(L,7,2))).toEqual(b.join({"   \053 \124  \042 \064\112\097\114\097\109 \098 \078\117\109\098\101\114","   \054 \124  \042 \064\114\101\116\117\114\110\115 \078\117\109\098\101\114","\062  \055 \124  \042\047","     \124  \094","   \056 \124";"   \057 \124 \102\117\110\099\116\105\111\110 \115\117\109\040\097\044 \098\041 \123";"  \049\048 \124   \114\101\116\117\114\110 \097 \043 \098"},"\n"))end)v("\110\111 \117\110\110\101\099\101\115\115\097\114\121 \112\097\100\100\105\110\103 \100\117\101 \116\111 \111\110\101-\111\102\102 \101\114\114\111\114\115",function()local L=b.join({"\047\042\042";" \042 \083\117\109\115 \116\119\111 \110\117\109\098\101\114\115\046"," \042"," \042 \064\112\097\114\097\109 \097 \078\117\109\098\101\114"," \042 \064\112\097\114\097\109 \098 \078\117\109\098\101\114"," \042 \064\114\101\116\117\114\110\115 \078\117\109\098\101\114"," \042\047","";"\102\117\110\099\116\105\111\110 \115\117\109\040\097\044 \098\041 \123","  \114\101\116\117\114\110 \097 \043 \098";"\125"},"\n");(F(e(L,6,2))).toEqual(b.join({"  \052 \124  \042 \064\112\097\114\097\109 \097 \078\117\109\098\101\114","  \053 \124  \042 \064\112\097\114\097\109 \098 \078\117\109\098\101\114","\062 \054 \124  \042 \064\114\101\116\117\114\110\115 \078\117\109\098\101\114";"    \124  \094","  \055 \124  \042\047","  \056 \124";"  \057 \124 \102\117\110\099\116\105\111\110 \115\117\109\040\097\044 \098\041 \123"},"\n"))end)v("\116\097\098\115",function()local L=b.join({"\t\099\108\097\115\115 \070\111\111 \123";"\t  \t\t    \099\111\110\115\116\114\117\099\116\111\114\t\040\t\041";"\t\125\059"},"\n");(F(e(L,2,25))).toEqual(b.join({"  \049 \124 \t\099\108\097\115\115 \070\111\111 \123","\062 \050 \124 \t  \t\t    \099\111\110\115\116\114\117\099\116\111\114\t\040\t\041";"    \124 \t  \t\t               \t \t \094";"  \051 \124 \t\125\059"},"\n"))end)v.skip("\111\112\116\115\046\104\105\103\104\108\105\103\104\116\067\111\100\101",function()local L="\099\111\110\115\111\108\101\046\108\111\103\040\'\098\097\098\101\108\'\041"local u=e(L,1,9,{highlightCode=true})local M=r(u);(F(#u)).toBeGreaterThan(#M);(F(M)).toEqual(b.join({"\062 \049 \124 \099\111\110\115\111\108\101\046\108\111\103\040\'\098\097\098\101\108\'\041";"    \124         \094"},"\n"))end)v.skip("\111\112\116\115\046\104\105\103\104\108\105\103\104\116\067\111\100\101 \119\105\116\104 \109\117\108\116\105\112\108\101 \099\111\108\117\109\110\115 \097\110\100 \108\105\110\101\115",function()local L=b.join({"\102\117\110\099\116\105\111\110 \097\040\098\044 \099\041 \123","  \114\101\116\117\114\110 \098 \043 \099\059";"\125"},"\n")local u=K(L,{start={line=1,column=1};["\101\110\100"]={line=3,column=1}},{highlightCode=true,message="\077\101\115\115\097\103\101 \097\098\111\117\116 \116\104\105\110\103\115"})local M=r(u);(F(M)).toEqual(b.join({"\062 \049 \124 \102\117\110\099\116\105\111\110 \097\040\098\044 \099\041 \123";"    \124 \094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094","\062 \050 \124   \114\101\116\117\114\110 \098 \043 \099\059";"    \124 \094\094\094\094\094\094\094\094\094\094\094\094\094\094\094";"\062 \051 \124 \125","    \124 \094 \077\101\115\115\097\103\101 \097\098\111\117\116 \116\104\105\110\103\115"},"\n"))end)v("\111\112\116\115\046\108\105\110\101\115\065\098\111\118\101",function()local L=b.join({"\047\042\042"," \042 \083\117\109\115 \116\119\111 \110\117\109\098\101\114\115\046";" \042"," \042 \064\112\097\114\097\109 \097 \078\117\109\098\101\114"," \042 \064\112\097\114\097\109 \098 \078\117\109\098\101\114"," \042 \064\114\101\116\117\114\110\115 \078\117\109\098\101\114";" \042\047";"","\102\117\110\099\116\105\111\110 \115\117\109\040\097\044 \098\041 \123","  \114\101\116\117\114\110 \097 \043 \098","\125"},"\n");(F(e(L,7,2,{linesAbove=1}))).toEqual(b.join({"   \054 \124  \042 \064\114\101\116\117\114\110\115 \078\117\109\098\101\114","\062  \055 \124  \042\047","     \124  \094";"   \056 \124","   \057 \124 \102\117\110\099\116\105\111\110 \115\117\109\040\097\044 \098\041 \123";"  \049\048 \124   \114\101\116\117\114\110 \097 \043 \098"},"\n"))end)v("\111\112\116\115\046\108\105\110\101\115\066\101\108\111\119",function()local L=b.join({"\047\042\042"," \042 \083\117\109\115 \116\119\111 \110\117\109\098\101\114\115\046"," \042"," \042 \064\112\097\114\097\109 \097 \078\117\109\098\101\114";" \042 \064\112\097\114\097\109 \098 \078\117\109\098\101\114";" \042 \064\114\101\116\117\114\110\115 \078\117\109\098\101\114"," \042\047";"";"\102\117\110\099\116\105\111\110 \115\117\109\040\097\044 \098\041 \123";"  \114\101\116\117\114\110 \097 \043 \098";"\125"},"\n");(F(e(L,7,2,{linesBelow=1}))).toEqual(b.join({"  \053 \124  \042 \064\112\097\114\097\109 \098 \078\117\109\098\101\114";"  \054 \124  \042 \064\114\101\116\117\114\110\115 \078\117\109\098\101\114";"\062 \055 \124  \042\047","    \124  \094","  \056 \124"},"\n"))end)v("\111\112\116\115\046\108\105\110\101\115\065\098\111\118\101 \097\110\100 \111\112\116\115\046\108\105\110\101\115\066\101\108\111\119",function()local L=b.join({"\047\042\042";" \042 \083\117\109\115 \116\119\111 \110\117\109\098\101\114\115\046"," \042";" \042 \064\112\097\114\097\109 \097 \078\117\109\098\101\114"," \042 \064\112\097\114\097\109 \098 \078\117\109\098\101\114";" \042 \064\114\101\116\117\114\110\115 \078\117\109\098\101\114"," \042\047";"";"\102\117\110\099\116\105\111\110 \115\117\109\040\097\044 \098\041 \123","  \114\101\116\117\114\110 \097 \043 \098","\125"},"\n");(F(e(L,7,2,{linesAbove=1;linesBelow=1}))).toEqual(b.join({"  \054 \124  \042 \064\114\101\116\117\114\110\115 \078\117\109\098\101\114","\062 \055 \124  \042\047";"    \124  \094","  \056 \124"},"\n"))end)v("\111\112\116\115\046\108\105\110\101\115\065\098\111\118\101 \110\111 \108\105\110\101\115 \097\098\111\118\101",function()local L=b.join({"\099\108\097\115\115 \070\111\111 \123";"  \099\111\110\115\116\114\117\099\116\111\114\040\041 \123";"    \099\111\110\115\111\108\101\046\108\111\103\040\097\114\103\117\109\101\110\116\115\041\059";"  \125","\125\059"},"\n");(F(K(L,{start={line=2}},{linesAbove=0}))).toEqual(b.join({"\062 \050 \124   \099\111\110\115\116\114\117\099\116\111\114\040\041 \123","  \051 \124     \099\111\110\115\111\108\101\046\108\111\103\040\097\114\103\117\109\101\110\116\115\041\059";"  \052 \124   \125";"  \053 \124 \125\059"},"\n"))end)v("\111\112\116\115\046\108\105\110\101\115\066\101\108\111\119 \110\111 \108\105\110\101\115 \098\101\108\111\119",function()local L=b.join({"\099\108\097\115\115 \070\111\111 \123","  \099\111\110\115\116\114\117\099\116\111\114\040\041 \123";"    \099\111\110\115\111\108\101\046\108\111\103\040\097\114\103\117\109\101\110\116\115\041\059","  \125";"\125\059"},"\n");(F(K(L,{start={line=2}},{linesBelow=0}))).toEqual(b.join({"  \049 \124 \099\108\097\115\115 \070\111\111 \123","\062 \050 \124   \099\111\110\115\116\114\117\099\116\111\114\040\041 \123"},"\n"))end)v("\111\112\116\115\046\108\105\110\101\115\066\101\108\111\119 \115\105\110\103\108\101 \108\105\110\101",function()local L=b.join({"\099\108\097\115\115 \070\111\111 \123";"  \099\111\110\115\116\114\117\099\116\111\114\040\041 \123";"    \099\111\110\115\111\108\101\046\108\111\103\040\097\114\103\117\109\101\110\116\115\041\059","  \125","\125\059"},"\n");(F(K(L,{start={line=2}},{linesAbove=0;linesBelow=0}))).toEqual(b.join({"\062 \050 \124   \099\111\110\115\116\114\117\099\116\111\114\040\041 \123"},"\n"))end)v.skip("\111\112\116\115\046\102\111\114\099\101\067\111\108\111\114",function()local L=d.red.bold local u=d.grey local M=b.join({"";"","",""},"\n");(F(e(M,3,nil,{linesAbove=1,linesBelow=1,forceColor=true}))).toEqual(d.reset(b.join({" "..u(" \050 \124");L("\062")..u(" \051 \124")," "..u(" \052 \124")},"\n")))end)v.skip("\106\115\120",function()local L=d.grey local u=d.yellow local M=b.join({"\060\100\105\118 \047\062"},"\n");(F(J:JSONEncode(e(M,0,nil,{linesAbove=1;linesBelow=1,forceColor=true})))).toEqual(J:JSONEncode(d.reset(" "..(L(" \049 \124")..(" "..(u("\060")..(u("\100\105\118")..(" "..(u("\047")..u("\062"))))))))))end)v("\098\097\115\105\099 \117\115\097\103\101\044 \110\101\119 \065\080\073",function()local L=b.join({"\099\108\097\115\115 \070\111\111 \123","  \099\111\110\115\116\114\117\099\116\111\114\040\041";"\125\059"},"\n");(F(K(L,{start={line=2,column=16}}))).toEqual(b.join({"  \049 \124 \099\108\097\115\115 \070\111\111 \123","\062 \050 \124   \099\111\110\115\116\114\117\099\116\111\114\040\041","    \124                \094";"  \051 \124 \125\059"},"\n"))end)v("\109\097\114\107 \109\117\108\116\105\112\108\101 \099\111\108\117\109\110\115",function()local L=b.join({"\099\108\097\115\115 \070\111\111 \123","  \099\111\110\115\116\114\117\099\116\111\114\040\041","\125\059"},"\n");(F(K(L,{start={line=2,column=3};["\101\110\100"]={line=2,column=16}}))).toEqual(b.join({"  \049 \124 \099\108\097\115\115 \070\111\111 \123","\062 \050 \124   \099\111\110\115\116\114\117\099\116\111\114\040\041";"    \124   \094\094\094\094\094\094\094\094\094\094\094\094\094";"  \051 \124 \125\059"},"\n"))end)v("\109\097\114\107 \109\117\108\116\105\112\108\101 \099\111\108\117\109\110\115 \097\099\114\111\115\115 \108\105\110\101\115",function()local L=b.join({"\099\108\097\115\115 \070\111\111 \123","  \099\111\110\115\116\114\117\099\116\111\114\040\041 \123","  \125","\125\059"},"\n");(F(K(L,{start={line=2;column=17},["\101\110\100"]={line=3;column=3}}))).toEqual(b.join({"  \049 \124 \099\108\097\115\115 \070\111\111 \123","\062 \050 \124   \099\111\110\115\116\114\117\099\116\111\114\040\041 \123";"    \124                 \094","\062 \051 \124   \125","    \124 \094\094\094","  \052 \124 \125\059"},"\n"))end)v("\109\097\114\107 \109\117\108\116\105\112\108\101 \099\111\108\117\109\110\115 \097\099\114\111\115\115 \109\117\108\116\105\112\108\101 \108\105\110\101\115",function()local L=b.join({"\099\108\097\115\115 \070\111\111 \123";"  \099\111\110\115\116\114\117\099\116\111\114\040\041 \123","    \099\111\110\115\111\108\101\046\108\111\103\040\097\114\103\117\109\101\110\116\115\041\059","  \125","\125\059"},"\n");(F(K(L,{start={line=2,column=17},["\101\110\100"]={line=4;column=3}}))).toEqual(b.join({"  \049 \124 \099\108\097\115\115 \070\111\111 \123","\062 \050 \124   \099\111\110\115\116\114\117\099\116\111\114\040\041 \123","    \124                 \094","\062 \051 \124     \099\111\110\115\111\108\101\046\108\111\103\040\097\114\103\117\109\101\110\116\115\041\059";"    \124 \094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094";"\062 \052 \124   \125","    \124 \094\094\094","  \053 \124 \125\059"},"\n"))end)v("\109\097\114\107 \097\099\114\111\115\115 \109\117\108\116\105\112\108\101 \108\105\110\101\115 \119\105\116\104\111\117\116 \099\111\108\117\109\110\115",function()local L=b.join({"\099\108\097\115\115 \070\111\111 \123";"  \099\111\110\115\116\114\117\099\116\111\114\040\041 \123";"    \099\111\110\115\111\108\101\046\108\111\103\040\097\114\103\117\109\101\110\116\115\041\059";"  \125","\125\059"},"\n");(F(K(L,{start={line=2},["\101\110\100"]={line=4}}))).toEqual(b.join({"  \049 \124 \099\108\097\115\115 \070\111\111 \123","\062 \050 \124   \099\111\110\115\116\114\117\099\116\111\114\040\041 \123";"\062 \051 \124     \099\111\110\115\111\108\101\046\108\111\103\040\097\114\103\117\109\101\110\116\115\041\059","\062 \052 \124   \125","  \053 \124 \125\059"},"\n"))end)v("\111\112\116\115\046\109\101\115\115\097\103\101",function()local L=b.join({"\099\108\097\115\115 \070\111\111 \123","  \099\111\110\115\116\114\117\099\116\111\114\040\041","\125\059"},"\n");(F(K(L,{start={line=2;column=16}},{message="\077\105\115\115\105\110\103 \123"}))).toEqual(b.join({"  \049 \124 \099\108\097\115\115 \070\111\111 \123","\062 \050 \124   \099\111\110\115\116\114\117\099\116\111\114\040\041";"    \124                \094 \077\105\115\115\105\110\103 \123";"  \051 \124 \125\059"},"\n"))end)v("\111\112\116\115\046\109\101\115\115\097\103\101 \119\105\116\104\111\117\116 \099\111\108\117\109\110",function()local L=b.join({"\099\108\097\115\115 \070\111\111 \123";"  \099\111\110\115\116\114\117\099\116\111\114\040\041";"\125\059"},"\n");(F(K(L,{start={line=2}},{message="\077\105\115\115\105\110\103 \123"}))).toEqual(b.join({"  \077\105\115\115\105\110\103 \123";"  \049 \124 \099\108\097\115\115 \070\111\111 \123","\062 \050 \124   \099\111\110\115\116\114\117\099\116\111\114\040\041";"  \051 \124 \125\059"},"\n"))end)v("\111\112\116\115\046\109\101\115\115\097\103\101 \119\105\116\104 \109\117\108\116\105\112\108\101 \108\105\110\101\115",function()local L=b.join({"\099\108\097\115\115 \070\111\111 \123";"  \099\111\110\115\116\114\117\099\116\111\114\040\041 \123";"    \099\111\110\115\111\108\101\046\108\111\103\040\097\114\103\117\109\101\110\116\115\041\059","  \125","\125\059"},"\n");(F(K(L,{start={line=2;column=17},["\101\110\100"]={line=4,column=3}},{message="\115\111\109\101\116\104\105\110\103 \097\098\111\117\116 \116\104\101 \099\111\110\115\116\114\117\099\116\111\114 \098\111\100\121"}))).toEqual(b.join({"  \049 \124 \099\108\097\115\115 \070\111\111 \123","\062 \050 \124   \099\111\110\115\116\114\117\099\116\111\114\040\041 \123";"    \124                 \094";"\062 \051 \124     \099\111\110\115\111\108\101\046\108\111\103\040\097\114\103\117\109\101\110\116\115\041\059","    \124 \094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094\094","\062 \052 \124   \125";"    \124 \094\094\094 \115\111\109\101\116\104\105\110\103 \097\098\111\117\116 \116\104\101 \099\111\110\115\116\114\117\099\116\111\114 \098\111\100\121";"  \053 \124 \125\059"},"\n"))end)v("\111\112\116\115\046\109\101\115\115\097\103\101 \119\105\116\104 \109\117\108\116\105\112\108\101 \108\105\110\101\115 \119\105\116\104\111\117\116 \099\111\108\117\109\110\115",function()local L=b.join({"\099\108\097\115\115 \070\111\111 \123";"  \099\111\110\115\116\114\117\099\116\111\114\040\041 \123";"    \099\111\110\115\111\108\101\046\108\111\103\040\097\114\103\117\109\101\110\116\115\041\059";"  \125";"\125\059"},"\n");(F(K(L,{start={line=2};["\101\110\100"]={line=4}},{message="\115\111\109\101\116\104\105\110\103 \097\098\111\117\116 \116\104\101 \099\111\110\115\116\114\117\099\116\111\114 \098\111\100\121"}))).toEqual(b.join({"  \115\111\109\101\116\104\105\110\103 \097\098\111\117\116 \116\104\101 \099\111\110\115\116\114\117\099\116\111\114 \098\111\100\121","  \049 \124 \099\108\097\115\115 \070\111\111 \123","\062 \050 \124   \099\111\110\115\116\114\117\099\116\111\114\040\041 \123";"\062 \051 \124     \099\111\110\115\111\108\101\046\108\111\103\040\097\114\103\117\109\101\110\116\115\041\059","\062 \052 \124   \125","  \053 \124 \125\059"},"\n"))end)end)return{}
-- ROBLOX upstream: https://github.com/babel/babel/blob/v7.18.5/packages/babel-code-frame/test/index.js
local Packages = script.Parent.Parent.Parent.Parent

local LuauPolyfill = require(Packages.LuauPolyfill)
local Array = LuauPolyfill.Array

local JestGlobals = require(Packages.JestGlobals)
local expect = JestGlobals.expect
local describe = JestGlobals.describe
local test = JestGlobals.test

local HttpService = game:GetService("HttpService")

local chalk = require(Packages.Chalk)
local stripAnsi = require(script.Parent.Parent["strip-ansi"])
local babelCodeFrame = require(script.Parent.Parent["babel-code-frame"])
local _codeFrame = babelCodeFrame.default
local codeFrameColumns = babelCodeFrame.codeFrameColumns
-- ROBLOX deviation START: functions do not have props in Lua
local codeFrame = _codeFrame
-- ROBLOX deviation END

describe("@babel/code-frame", function()
	test("basic usage", function()
		local rawLines = Array.join({ "class Foo {", "  constructor()", "};" }, "\n")
		expect(codeFrame(rawLines, 2, 16)).toEqual(Array.join({
			"  1 | class Foo {",
			"> 2 |   constructor()",
			"    |                ^",
			"  3 | };",
		}, "\n"))
	end)
	test("optional column number", function()
		local rawLines = Array.join({ "class Foo {", "  constructor()", "};" }, "\n")
		expect(codeFrame(rawLines, 2, nil)).toEqual(
			Array.join({ "  1 | class Foo {", "> 2 |   constructor()", "  3 | };" }, "\n")
		)
	end)
	test("maximum context lines and padding", function()
		local rawLines = Array.join({
			"/**",
			" * Sums two numbers.",
			" *",
			" * @param a Number",
			" * @param b Number",
			" * @returns Number",
			" */",
			"",
			"function sum(a, b) {",
			"  return a + b",
			"}",
		}, "\n")
		expect(codeFrame(rawLines, 7, 2)).toEqual(Array.join({
			"   5 |  * @param b Number",
			"   6 |  * @returns Number",
			">  7 |  */",
			"     |  ^",
			"   8 |",
			"   9 | function sum(a, b) {",
			"  10 |   return a + b",
		}, "\n"))
	end)
	test("no unnecessary padding due to one-off errors", function()
		local rawLines = Array.join({
			"/**",
			" * Sums two numbers.",
			" *",
			" * @param a Number",
			" * @param b Number",
			" * @returns Number",
			" */",
			"",
			"function sum(a, b) {",
			"  return a + b",
			"}",
		}, "\n")
		expect(codeFrame(rawLines, 6, 2)).toEqual(Array.join({
			"  4 |  * @param a Number",
			"  5 |  * @param b Number",
			"> 6 |  * @returns Number",
			"    |  ^",
			"  7 |  */",
			"  8 |",
			"  9 | function sum(a, b) {",
		}, "\n"))
	end)
	test("tabs", function()
		local rawLines = Array.join({ "\tclass Foo {", "\t  \t\t    constructor\t(\t)", "\t};" }, "\n")
		expect(codeFrame(rawLines, 2, 25)).toEqual(Array.join({
			"  1 | \tclass Foo {",
			"> 2 | \t  \t\t    constructor\t(\t)",
			"    | \t  \t\t               \t \t ^",
			"  3 | \t};",
		}, "\n"))
	end)
	-- ROBLOX FIXME: highlightCode not available
	test.skip("opts.highlightCode", function()
		local rawLines = "console.log('babel')"
		local result = codeFrame(rawLines, 1, 9, { highlightCode = true })
		local stripped = stripAnsi(result)
		expect(#result).toBeGreaterThan(#stripped)
		expect(stripped).toEqual(Array.join({ "> 1 | console.log('babel')", "    |         ^" }, "\n"))
	end)
	-- ROBLOX FIXME: highlightCode not available
	test.skip("opts.highlightCode with multiple columns and lines", function()
		-- prettier-ignore
		local rawLines = Array.join({ "function a(b, c) {", "  return b + c;", "}" }, "\n")
		local result = codeFrameColumns(
			rawLines,
			{ start = { line = 1, column = 1 }, ["end"] = { line = 3, column = 1 } },
			{ highlightCode = true, message = "Message about things" }
		)
		local stripped = stripAnsi(result)
		expect(stripped).toEqual(
			-- prettier-ignore
			Array.join({
				"> 1 | function a(b, c) {",
				"    | ^^^^^^^^^^^^^^^^^^",
				"> 2 |   return b + c;",
				"    | ^^^^^^^^^^^^^^^",
				"> 3 | }",
				"    | ^ Message about things",
			}, "\n")
		)
	end)
	test("opts.linesAbove", function()
		local rawLines = Array.join({
			"/**",
			" * Sums two numbers.",
			" *",
			" * @param a Number",
			" * @param b Number",
			" * @returns Number",
			" */",
			"",
			"function sum(a, b) {",
			"  return a + b",
			"}",
		}, "\n")
		expect(codeFrame(rawLines, 7, 2, { linesAbove = 1 })).toEqual(Array.join({
			"   6 |  * @returns Number",
			">  7 |  */",
			"     |  ^",
			"   8 |",
			"   9 | function sum(a, b) {",
			"  10 |   return a + b",
		}, "\n"))
	end)
	test("opts.linesBelow", function()
		local rawLines = Array.join({
			"/**",
			" * Sums two numbers.",
			" *",
			" * @param a Number",
			" * @param b Number",
			" * @returns Number",
			" */",
			"",
			"function sum(a, b) {",
			"  return a + b",
			"}",
		}, "\n")
		expect(codeFrame(rawLines, 7, 2, { linesBelow = 1 })).toEqual(Array.join({
			"  5 |  * @param b Number",
			"  6 |  * @returns Number",
			"> 7 |  */",
			"    |  ^",
			"  8 |",
		}, "\n"))
	end)
	test("opts.linesAbove and opts.linesBelow", function()
		local rawLines = Array.join({
			"/**",
			" * Sums two numbers.",
			" *",
			" * @param a Number",
			" * @param b Number",
			" * @returns Number",
			" */",
			"",
			"function sum(a, b) {",
			"  return a + b",
			"}",
		}, "\n")
		expect(codeFrame(rawLines, 7, 2, { linesAbove = 1, linesBelow = 1 })).toEqual(
			Array.join({ "  6 |  * @returns Number", "> 7 |  */", "    |  ^", "  8 |" }, "\n")
		)
	end)
	test("opts.linesAbove no lines above", function()
		local rawLines =
			Array.join({ "class Foo {", "  constructor() {", "    console.log(arguments);", "  }", "};" }, "\n")
		expect(codeFrameColumns(rawLines, { start = { line = 2 } }, { linesAbove = 0 })).toEqual(Array.join({
			"> 2 |   constructor() {",
			"  3 |     console.log(arguments);",
			"  4 |   }",
			"  5 | };",
		}, "\n"))
	end)
	test("opts.linesBelow no lines below", function()
		local rawLines =
			Array.join({ "class Foo {", "  constructor() {", "    console.log(arguments);", "  }", "};" }, "\n")
		expect(codeFrameColumns(rawLines, { start = { line = 2 } }, { linesBelow = 0 })).toEqual(
			Array.join({ "  1 | class Foo {", "> 2 |   constructor() {" }, "\n")
		)
	end)
	test("opts.linesBelow single line", function()
		local rawLines =
			Array.join({ "class Foo {", "  constructor() {", "    console.log(arguments);", "  }", "};" }, "\n")
		expect(codeFrameColumns(rawLines, { start = { line = 2 } }, { linesAbove = 0, linesBelow = 0 })).toEqual(
			Array.join({ "> 2 |   constructor() {" }, "\n")
		)
	end)
	-- ROBLOX FIXME: forceColor not available
	test.skip("opts.forceColor", function()
		local marker = chalk.red.bold
		local gutter = chalk.grey
		local rawLines = Array.join({ "", "", "", "" }, "\n")
		expect(codeFrame(rawLines, 3, nil, { linesAbove = 1, linesBelow = 1, forceColor = true })).toEqual(
			chalk.reset(Array.join({
				" " .. gutter(" 2 |"),
				marker(">") .. gutter(" 3 |"),
				" " .. gutter(" 4 |"),
			}, "\n"))
		)
	end)
	-- ROBLOX FIXME: forceColor not available
	test.skip("jsx", function()
		local gutter = chalk.grey
		local yellow = chalk.yellow
		local rawLines = Array.join({ "<div />" }, "\n")
		expect(
			HttpService:JSONEncode(codeFrame(rawLines, 0, nil, { linesAbove = 1, linesBelow = 1, forceColor = true }))
		).toEqual(
			HttpService:JSONEncode(
				chalk.reset(
					" " .. gutter(" 1 |") .. " " .. yellow("<") .. yellow("div") .. " " .. yellow("/") .. yellow(">")
				)
			)
		)
	end)
	test("basic usage, new API", function()
		local rawLines = Array.join({ "class Foo {", "  constructor()", "};" }, "\n")
		expect(codeFrameColumns(rawLines, { start = { line = 2, column = 16 } })).toEqual(Array.join({
			"  1 | class Foo {",
			"> 2 |   constructor()",
			"    |                ^",
			"  3 | };",
		}, "\n"))
	end)
	test("mark multiple columns", function()
		local rawLines = Array.join({ "class Foo {", "  constructor()", "};" }, "\n")
		expect(codeFrameColumns(rawLines, { start = { line = 2, column = 3 }, ["end"] = { line = 2, column = 16 } })).toEqual(
			Array.join({
				"  1 | class Foo {",
				"> 2 |   constructor()",
				"    |   ^^^^^^^^^^^^^",
				"  3 | };",
			}, "\n")
		)
	end)
	test("mark multiple columns across lines", function()
		local rawLines = Array.join({ "class Foo {", "  constructor() {", "  }", "};" }, "\n")
		expect(codeFrameColumns(rawLines, { start = { line = 2, column = 17 }, ["end"] = { line = 3, column = 3 } })).toEqual(
			Array.join({
				"  1 | class Foo {",
				"> 2 |   constructor() {",
				"    |                 ^",
				"> 3 |   }",
				"    | ^^^",
				"  4 | };",
			}, "\n")
		)
	end)
	test("mark multiple columns across multiple lines", function()
		local rawLines =
			Array.join({ "class Foo {", "  constructor() {", "    console.log(arguments);", "  }", "};" }, "\n")
		expect(codeFrameColumns(rawLines, { start = { line = 2, column = 17 }, ["end"] = { line = 4, column = 3 } })).toEqual(
			Array.join({
				"  1 | class Foo {",
				"> 2 |   constructor() {",
				"    |                 ^",
				"> 3 |     console.log(arguments);",
				"    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^",
				"> 4 |   }",
				"    | ^^^",
				"  5 | };",
			}, "\n")
		)
	end)
	test("mark across multiple lines without columns", function()
		local rawLines =
			Array.join({ "class Foo {", "  constructor() {", "    console.log(arguments);", "  }", "};" }, "\n")
		expect(codeFrameColumns(rawLines, { start = { line = 2 }, ["end"] = { line = 4 } })).toEqual(Array.join({
			"  1 | class Foo {",
			"> 2 |   constructor() {",
			"> 3 |     console.log(arguments);",
			"> 4 |   }",
			"  5 | };",
		}, "\n"))
	end)
	test("opts.message", function()
		local rawLines = Array.join({ "class Foo {", "  constructor()", "};" }, "\n")
		expect(codeFrameColumns(rawLines, { start = { line = 2, column = 16 } }, { message = "Missing {" })).toEqual(
			Array.join({
				"  1 | class Foo {",
				"> 2 |   constructor()",
				"    |                ^ Missing {",
				"  3 | };",
			}, "\n")
		)
	end)
	test("opts.message without column", function()
		local rawLines = Array.join({ "class Foo {", "  constructor()", "};" }, "\n")
		expect(codeFrameColumns(rawLines, { start = { line = 2 } }, { message = "Missing {" })).toEqual(
			Array.join({ "  Missing {", "  1 | class Foo {", "> 2 |   constructor()", "  3 | };" }, "\n")
		)
	end)
	test("opts.message with multiple lines", function()
		local rawLines =
			Array.join({ "class Foo {", "  constructor() {", "    console.log(arguments);", "  }", "};" }, "\n")
		expect(
			codeFrameColumns(
				rawLines,
				{ start = { line = 2, column = 17 }, ["end"] = { line = 4, column = 3 } },
				{ message = "something about the constructor body" }
			)
		).toEqual(Array.join({
			"  1 | class Foo {",
			"> 2 |   constructor() {",
			"    |                 ^",
			"> 3 |     console.log(arguments);",
			"    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^",
			"> 4 |   }",
			"    | ^^^ something about the constructor body",
			"  5 | };",
		}, "\n"))
	end)
	test("opts.message with multiple lines without columns", function()
		local rawLines =
			Array.join({ "class Foo {", "  constructor() {", "    console.log(arguments);", "  }", "};" }, "\n")
		expect(
			codeFrameColumns(
				rawLines,
				{ start = { line = 2 }, ["end"] = { line = 4 } },
				{ message = "something about the constructor body" }
			)
		).toEqual(Array.join({
			"  something about the constructor body",
			"  1 | class Foo {",
			"> 2 |   constructor() {",
			"> 3 |     console.log(arguments);",
			"> 4 |   }",
			"  5 | };",
		}, "\n"))
	end)
end)
return {}
