mirror of
https://github.com/angular/angular.git
synced 2026-12-06 05:09:14 -05:00
This commit removes a hack that deletes `Event` from the global context when using domino. Instead, it sets the global event to domino's implementation of `Event`. PR Close #53659
28 lines
962 B
TypeScript
28 lines
962 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.io/license
|
|
*/
|
|
|
|
// Needed to run animation tests
|
|
import '@angular/compiler'; // For JIT mode. Must be in front of any other @angular/* imports.
|
|
|
|
import {ɵgetDOM as getDOM} from '@angular/common';
|
|
import {DominoAdapter} from '@angular/platform-server/src/domino_adapter';
|
|
|
|
if (typeof window == 'undefined') {
|
|
const domino = require('../../../platform-server/src/bundled-domino');
|
|
|
|
DominoAdapter.makeCurrent();
|
|
(global as any).document = getDOM().getDefaultDocument();
|
|
|
|
// For animation tests, see
|
|
// https://github.com/angular/angular/blob/main/packages/animations/browser/src/render/shared.ts#L140
|
|
(global as any).Element = domino.impl.Element;
|
|
(global as any).isBrowser = false;
|
|
(global as any).isNode = true;
|
|
(global as any).Event = domino.impl.Event;
|
|
}
|