angular-cn/tools/@angular/tsc-wrapped/test/tsc.spec.ts

31 lines
693 B
TypeScript
Raw Normal View History

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(
() => `
{
"angularCompilerOptions": {
"googleClosureOutput": true
},
"compilerOptions": {
"module": "commonjs",
"outDir": "built"
}
2016-05-26 13:45:37 -04:00
}`,
() => ['tsconfig.json']);
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',
googleClosureOutput: true,
module: ts.ModuleKind.CommonJS,
outDir: 'basePath/built',
configFilePath: undefined
});
});
});