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