angular/packages/platform-browser/testing/src/browser.ts
Andrew Scott a253739ac8
refactor(core): Remove zone toggles for test and standalone
The migration is complete internally. All that remains is bootstrapModule
2025-10-28 15:57:58 +01:00

35 lines
1 KiB
TypeScript

/**
* @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
*/
import {ɵprovideFakePlatformNavigation} from '@angular/common/testing';
import {APP_ID, createPlatformFactory, NgModule, StaticProvider, PlatformRef} from '@angular/core';
import {TestComponentRenderer} from '@angular/core/testing';
import {BrowserModule, platformBrowser} from '../../index';
import {DOMTestComponentRenderer} from './dom_test_component_renderer';
/**
* Platform for testing
*
* @publicApi
*/
export const platformBrowserTesting: (extraProviders?: StaticProvider[]) => PlatformRef =
createPlatformFactory(platformBrowser, 'browserTesting');
/**
* NgModule for testing.
*
* @publicApi
*/
@NgModule({
exports: [BrowserModule],
providers: [
{provide: APP_ID, useValue: 'a'},
ɵprovideFakePlatformNavigation(),
{provide: TestComponentRenderer, useClass: DOMTestComponentRenderer},
],
})
export class BrowserTestingModule {}