mirror of
https://github.com/ChromeDevTools/chrome-devtools-mcp.git
synced 2026-11-04 15:00:11 +00:00
The branch cuts total test CPU time by 8% and serial wall time by 6%, because test files that do not use DevTools no longer load the 0.5 s DevTools bundle.
26 lines
670 B
TypeScript
26 lines
670 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2026 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* Prepares the polyfills and the DevTools frontend globals for tests.
|
|
*
|
|
* Import this module from each test file that uses DevTools code.
|
|
* tests/utils.ts and tests/mocks.ts import it, so test files that import
|
|
* them get it automatically.
|
|
*
|
|
* This module is not part of tests/setup.ts because it loads
|
|
* src/third_party/index.js, which takes about 0.5 s. Many test files do not
|
|
* need it.
|
|
*/
|
|
|
|
import '../src/utils/polyfill.js';
|
|
|
|
import {overrideDevToolsGlobals} from '../src/devtools/DevtoolsUtils.js';
|
|
|
|
overrideDevToolsGlobals({
|
|
loadResource: async () => '',
|
|
});
|