This ensures we run in a clean directory, using our real distribution. It finds bugs like @internal APIs needed to type-check in the offline compiler, as well as problems in package.json. Also move tsc-wrapped under tools/@angular
		
			
				
	
	
		
			31 lines
		
	
	
		
			693 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			693 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import * as ts from 'typescript';
 | 
						|
import {Tsc} from '../src/tsc';
 | 
						|
 | 
						|
describe('options parsing', () => {
 | 
						|
 | 
						|
  const tsc = new Tsc(
 | 
						|
      () => `
 | 
						|
{
 | 
						|
    "angularCompilerOptions": {
 | 
						|
        "googleClosureOutput": true
 | 
						|
    },
 | 
						|
    "compilerOptions": {
 | 
						|
        "module": "commonjs",
 | 
						|
        "outDir": "built"
 | 
						|
    }
 | 
						|
}`,
 | 
						|
      () => ['tsconfig.json']);
 | 
						|
 | 
						|
  it('should combine all options into ngOptions', () => {
 | 
						|
    const {parsed, ngOptions} = tsc.readConfiguration('projectDir', 'basePath');
 | 
						|
 | 
						|
    expect(ngOptions).toEqual({
 | 
						|
      genDir: 'basePath',
 | 
						|
      googleClosureOutput: true,
 | 
						|
      module: ts.ModuleKind.CommonJS,
 | 
						|
      outDir: 'basePath/built',
 | 
						|
      configFilePath: undefined
 | 
						|
    });
 | 
						|
  });
 | 
						|
});
 |