local w=require("\064\112\107\103\047\064\106\115\100\111\116\108\117\097\047\106\101\115\116-\103\108\111\098\097\108\115")local T=w.expect local a=w.describe local C=w.it local p=w.beforeEach a("\112\114\111\102\105\108\105\110\103 \117\116\105\108\115",function()local w p(function()w=require("\046\046\047\100\101\118\116\111\111\108\115\047\118\105\101\119\115\047\080\114\111\102\105\108\101\114\047\117\116\105\108\115")end)C("\115\104\111\117\108\100 \116\104\114\111\119 \105\102 \105\109\112\111\114\116\105\110\103 \111\108\100\101\114\047\117\110\115\117\112\112\111\114\116\101\100 \100\097\116\097",function()(T(function()return w.prepareProfilingDataFrontendFromExport({version=0,dataForRoots={}})end)).toThrow("\085\110\115\117\112\112\111\114\116\101\100 \112\114\111\102\105\108\101\114 \101\120\112\111\114\116 \118\101\114\115\105\111\110 \"\048\"")end)end)
-- ROBLOX upstream: https://github.com/facebook/react/blob/v17.0.1/packages/react-devtools-shared/src/__tests__/profilingUtils-test.js
--[[*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 ]]

local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local jestExpect = JestGlobals.expect
local describe = JestGlobals.describe
local it = JestGlobals.it
local beforeEach = JestGlobals.beforeEach

describe("profiling utils", function()
	local utils
	beforeEach(function()
		utils = require("../devtools/views/Profiler/utils")
	end)
	it("should throw if importing older/unsupported data", function()
		jestExpect(function()
			return utils.prepareProfilingDataFrontendFromExport({
				version = 0,
				dataForRoots = {},
			})
		end).toThrow('Unsupported profiler export version "0"')
	end)
end)
