mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Since we no properly initialize as part of the spec-entrypoint the hacky logic starting Jasmine can be removed. The init file now runs before tests run, but after Jasmine is initialized. Calling `boot` while Jasmine is already initialized results in tests executing in a different context and before other initialization work completes. PR Close #48521
32 lines
1.2 KiB
TypeScript
32 lines
1.2 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.io/license
|
|
*/
|
|
|
|
import 'zone.js/lib/node/rollup-main';
|
|
import 'zone.js/lib/zone-spec/long-stack-trace';
|
|
import 'zone.js/lib/zone-spec/task-tracking';
|
|
import 'zone.js/lib/zone-spec/proxy';
|
|
import 'zone.js/lib/zone-spec/sync-test';
|
|
import 'zone.js/lib/testing/async-testing';
|
|
import 'zone.js/lib/testing/fake-async';
|
|
import 'reflect-metadata/Reflect';
|
|
import 'zone.js/lib/jasmine/jasmine';
|
|
|
|
(global as any).isNode = true;
|
|
(global as any).isBrowser = false;
|
|
|
|
import '@angular/compiler'; // For JIT mode. Must be in front of any other @angular/* imports.
|
|
// Init TestBed
|
|
import {TestBed} from '@angular/core/testing';
|
|
import {ServerTestingModule, platformServerTesting} from '@angular/platform-server/testing/src/server';
|
|
import {DominoAdapter} from '@angular/platform-server/src/domino_adapter';
|
|
import {createDocument} from 'domino';
|
|
|
|
TestBed.initTestEnvironment(ServerTestingModule, platformServerTesting());
|
|
DominoAdapter.makeCurrent();
|
|
(global as any).document =
|
|
(DominoAdapter as any).defaultDoc || ((DominoAdapter as any).defaultDoc = createDocument());
|