Files
Alex Rudenko 6cfbdf933b test: load DevTools in test setup only for files that use it (#3178)
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.
2026-10-16 09:01:32 +00:00

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 () => '',
});