/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
devtools/projects/ng-devtools-backend/src/lib/profiling/performance-track.spec.ts
31 строка
886 B
splincode
fix(devtools): avoid initializing profiler in production mode
30 июл 2026, 02:51
30 июл 2026, 02:51
1a2bcb2
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ describe('performance track', () => { const globalWithAngularDebugApi = window as unknown as {ng?: unknown}; let angularDebugApi: unknown; beforeEach(() => { angularDebugApi = globalWithAngularDebugApi.ng; globalWithAngularDebugApi.ng = {}; }); afterEach(() => { if (angularDebugApi === undefined) { delete globalWithAngularDebugApi.ng; } else { globalWithAngularDebugApi.ng = angularDebugApi; } }); it('does not throw an error when initialized in development mode', async () => { const performanceTrack = await import('./performance-track'); expect(() => performanceTrack.enablePerformanceTrack()).not.toThrow(); }); });