| 
									
										
										
										
											2016-05-24 10:53:48 -07:00
										 |  |  | import * as ts from 'typescript'; | 
					
						
							|  |  |  | import {Tsc} from '../src/tsc'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | describe('options parsing', () => { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-26 10:45:37 -07:00
										 |  |  |   const tsc = new Tsc( | 
					
						
							|  |  |  |       () => `
 | 
					
						
							| 
									
										
										
										
											2016-05-24 10:53:48 -07:00
										 |  |  | { | 
					
						
							|  |  |  |     "angularCompilerOptions": { | 
					
						
							|  |  |  |         "googleClosureOutput": true | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     "compilerOptions": { | 
					
						
							|  |  |  |         "module": "commonjs", | 
					
						
							|  |  |  |         "outDir": "built" | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2016-05-26 10:45:37 -07:00
										 |  |  | }`,
 | 
					
						
							|  |  |  |       () => ['tsconfig.json']); | 
					
						
							| 
									
										
										
										
											2016-05-24 10:53:48 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   it('should combine all options into ngOptions', () => { | 
					
						
							|  |  |  |     const {parsed, ngOptions} = tsc.readConfiguration('projectDir', 'basePath'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     expect(ngOptions).toEqual({ | 
					
						
							| 
									
										
										
										
											2016-05-26 10:45:37 -07:00
										 |  |  |       genDir: 'basePath', | 
					
						
							| 
									
										
										
										
											2016-05-24 10:53:48 -07:00
										 |  |  |       googleClosureOutput: true, | 
					
						
							|  |  |  |       module: ts.ModuleKind.CommonJS, | 
					
						
							|  |  |  |       outDir: 'basePath/built', | 
					
						
							|  |  |  |       configFilePath: undefined | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | }); |