2017-12-16 14:35:47 -05:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. 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/dist/zone-node.js';
|
|
|
|
import 'zone.js/dist/long-stack-trace-zone.js';
|
|
|
|
import 'zone.js/dist/proxy.js';
|
|
|
|
import 'zone.js/dist/sync-test.js';
|
|
|
|
import 'zone.js/dist/async-test.js';
|
|
|
|
import 'zone.js/dist/fake-async-test.js';
|
2017-04-27 14:44:14 -04:00
|
|
|
import 'zone.js/dist/task-tracking.js';
|
2017-12-16 14:35:47 -05:00
|
|
|
import 'reflect-metadata/Reflect';
|
|
|
|
|
2019-02-21 17:22:06 -05:00
|
|
|
// We must first initialize jasmine-core before calling
|
|
|
|
// requiring `zone.js/dist/jasmine-patch.js` which patches
|
|
|
|
// jasmine ENV with code which understands ProxyZone.
|
|
|
|
// jasmine_node_test under Bazel will check if `jasmineCore.boot(jasmineCore)`
|
|
|
|
// has been called and re-use the env if it has.
|
|
|
|
// See https://github.com/bazelbuild/rules_nodejs/pull/539
|
2017-12-16 14:35:47 -05:00
|
|
|
const jasmineCore: any = require('jasmine-core');
|
2019-02-21 17:22:06 -05:00
|
|
|
jasmineCore.boot(jasmineCore);
|
2017-12-16 14:35:47 -05:00
|
|
|
import 'zone.js/dist/jasmine-patch.js';
|
|
|
|
|
2017-12-17 18:10:54 -05:00
|
|
|
(global as any).isNode = true;
|
|
|
|
(global as any).isBrowser = false;
|
|
|
|
|
2018-10-24 19:02:25 -04:00
|
|
|
import '@angular/compiler'; // For JIT mode. Must be in front of any other @angular/* imports.
|
2017-12-16 14:35:47 -05:00
|
|
|
// 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';
|
2018-10-19 19:43:31 -04:00
|
|
|
import {createDocument} from 'domino';
|
2017-12-16 14:35:47 -05:00
|
|
|
|
|
|
|
TestBed.initTestEnvironment(ServerTestingModule, platformServerTesting());
|
|
|
|
DominoAdapter.makeCurrent();
|
2018-10-19 19:43:31 -04:00
|
|
|
(global as any).document =
|
|
|
|
(DominoAdapter as any).defaultDoc || ((DominoAdapter as any).defaultDoc = createDocument());
|