feat(tsc-wrapped): Support of vinyl like config file was added (#13987)

This feature was implemented in order to provide easier way of use in gulp
This commit is contained in:
jolly-roger
2017-01-24 22:51:14 +02:00
committed by Alex Rickabaugh
parent 83361d811d
commit 0c7726dd74
5 changed files with 91 additions and 11 deletions

View File

@ -91,6 +91,35 @@ describe('tsc-wrapped', () => {
.catch(e => done.fail(e));
});
it('should pre-process sources using config from vinyl like object', (done) => {
const config = {
path: basePath + '/tsconfig.json',
contents: new Buffer(JSON.stringify({
compilerOptions: {
experimentalDecorators: true,
types: [],
outDir: 'built',
declaration: true,
moduleResolution: 'node',
target: 'es2015'
},
angularCompilerOptions: {annotateForClosureCompiler: true},
files: ['test.ts']
}))
};
main(config, {basePath})
.then(() => {
const out = readOut('js');
// Expand `export *` and fix index import
expect(out).toContain(`export { A, B } from './dep/index'`);
// Annotated for Closure compiler
expect(out).toContain('* @param {?} x');
done();
})
.catch(e => done.fail(e));
});
it('should allow all options disabled', (done) => {
write('tsconfig.json', `{
"compilerOptions": {