mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This updates tests and examples only to prepare for zoneless by default. These changes were identified and made as part of #63382. Anything that failed gets `provideZoneChangeDetection` unless the fixes were easily and quickly determined. It also adds the zoneless provider to the `initTestEnvironment` calls for tests in this repo to prevent regressions before #63382 is merged. PR Close #63668
29 lines
952 B
TypeScript
29 lines
952 B
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 'zone.js';
|
|
import './zone_base_setup.mjs';
|
|
import '@angular/compiler'; // For JIT mode. Must be in front of any other @angular/* imports.
|
|
|
|
import {NgModule, provideZonelessChangeDetection} from '@angular/core';
|
|
import {TestBed} from '@angular/core/testing';
|
|
import {BrowserTestingModule, platformBrowserTesting} from '@angular/platform-browser/testing';
|
|
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
|
|
@NgModule({
|
|
providers: [provideZonelessChangeDetection()],
|
|
})
|
|
export class TestModule {}
|
|
|
|
TestBed.initTestEnvironment(
|
|
[BrowserTestingModule, NoopAnimationsModule, TestModule],
|
|
platformBrowserTesting(),
|
|
);
|
|
|
|
(window as any).isNode = false;
|
|
(window as any).isBrowser = true;
|
|
(window as any).global = window;
|