| 
									
										
										
										
											2018-08-28 14:13:22 -07: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 {nocollapseHack} from '../../src/transformers/nocollapse_hack'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | describe('@nocollapse hack', () => { | 
					
						
							|  |  |  |   it('should add @nocollapse to a basic class', () => { | 
					
						
							| 
									
										
										
										
											2019-10-14 15:28:01 -07:00
										 |  |  |     const decl = `Foo.ɵinj = define(...);`; | 
					
						
							| 
									
										
										
										
											2018-08-28 14:13:22 -07:00
										 |  |  |     expect(nocollapseHack(decl)).toEqual('/** @nocollapse */ ' + decl); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   it('should add nocollapse to an if (false) declaration of the kind generated by tsickle', () => { | 
					
						
							|  |  |  |     const decl = `
 | 
					
						
							|  |  |  |       if (false) { | 
					
						
							|  |  |  |         /** @type {?} */ | 
					
						
							| 
									
										
										
										
											2019-10-14 15:28:01 -07:00
										 |  |  |         Foo.ɵinj; | 
					
						
							| 
									
										
										
										
											2018-08-28 14:13:22 -07:00
										 |  |  |       } | 
					
						
							|  |  |  |     `;
 | 
					
						
							|  |  |  |     expect(nocollapseHack(decl)).toContain('/** @nocollapse @type {?} */'); | 
					
						
							|  |  |  |   }); | 
					
						
							| 
									
										
										
										
											2019-10-14 15:28:01 -07:00
										 |  |  | }); |