MCPcopy Create free account
hub / github.com/ReactTooltip/react-tooltip / createBenchmarkPage

Function createBenchmarkPage

benchmarks/run-benchmark.mjs:209–230  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

207 const fixtureBundleContent = await readFile(fixtureBundlePath, 'utf8')
208
209 async function createBenchmarkPage() {
210 const page = await browser.newPage()
211 page.on('console', (message) => {
212 const text = message.text()
213 if (text.includes('Download the React DevTools')) {
214 return
215 }
216 console.log(`[page:${message.type()}] ${text}`)
217 })
218 page.on('pageerror', (error) => {
219 console.error(`[pageerror] ${error.message}`)
220 })
221
222 await page.goto(pathToFileURL(cacheHtmlPath).toString(), {
223 waitUntil: 'networkidle',
224 })
225 await page.addScriptTag({ content: fixtureBundleContent })
226 await page.waitForFunction(() => Boolean(window.__reactTooltipBenchmark), null, {
227 timeout: timeoutMs,
228 })
229 return page
230 }
231
232 logProgress(`Running scaling benchmark for counts: ${counts.join(', ')}`)
233

Callers 1

runVersionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected