https://github.com/angular/angular
Raw File
Tip revision: 75d5bfda1ea5396fa5210e978af1217405e4a041 authored by Jessica Janiuk on 08 March 2023, 18:38:46 UTC
release: cut the v15.2.2 release
Tip revision: 75d5bfd
node_tests.init.ts
/**
 * @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_base_setup';

(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 domino from 'domino';

TestBed.initTestEnvironment(ServerTestingModule, platformServerTesting());
DominoAdapter.makeCurrent();
(global as any).document = (DominoAdapter as any).defaultDoc ||
    ((DominoAdapter as any).defaultDoc = domino.createDocument());
back to top