| 
									
										
										
										
											2017-12-01 14:23:03 -08: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
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-15 17:50:54 +01:00
										 |  |  | // Needed to run animation tests
 | 
					
						
							| 
									
										
										
										
											2019-10-06 12:06:53 +09:00
										 |  |  | import 'zone.js/lib/node/rollup-main'; | 
					
						
							| 
									
										
										
										
											2018-10-24 16:02:25 -07:00
										 |  |  | import '@angular/compiler'; // For JIT mode. Must be in front of any other @angular/* imports.
 | 
					
						
							| 
									
										
										
										
											2019-08-22 19:16:25 -07:00
										 |  |  | import {ɵgetDOM as getDOM} from '@angular/common'; | 
					
						
							| 
									
										
										
										
											2019-10-06 12:06:53 +09:00
										 |  |  | import {DominoAdapter} from '@angular/platform-server/src/domino_adapter'; | 
					
						
							| 
									
										
										
										
											2018-01-03 11:42:48 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  | if (typeof window == 'undefined') { | 
					
						
							| 
									
										
										
										
											2017-12-15 17:50:54 +01:00
										 |  |  |   const domino = require('domino'); | 
					
						
							| 
									
										
										
										
											2018-01-03 11:42:48 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   DominoAdapter.makeCurrent(); | 
					
						
							|  |  |  |   (global as any).document = getDOM().getDefaultDocument(); | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Trick to avoid Event patching from
 | 
					
						
							|  |  |  |   // https://github.com/angular/angular/blob/7cf5e95ac9f0f2648beebf0d5bd9056b79946970/packages/platform-browser/src/dom/events/dom_events.ts#L112-L132
 | 
					
						
							|  |  |  |   // It fails with Domino with TypeError: Cannot assign to read only property
 | 
					
						
							|  |  |  |   // 'stopImmediatePropagation' of object '#<Event>'
 | 
					
						
							|  |  |  |   (global as any).Event = null; | 
					
						
							| 
									
										
										
										
											2017-12-15 17:50:54 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // For animation tests, see
 | 
					
						
							|  |  |  |   // https://github.com/angular/angular/blob/master/packages/animations/browser/src/render/shared.ts#L140
 | 
					
						
							|  |  |  |   (global as any).Element = domino.impl.Element; | 
					
						
							| 
									
										
										
										
											2018-02-03 20:34:30 -08:00
										 |  |  |   (global as any).isBrowser = false; | 
					
						
							|  |  |  |   (global as any).isNode = true; | 
					
						
							| 
									
										
										
										
											2017-12-01 14:23:03 -08:00
										 |  |  | } |