refactor(compiler): don’t write summaries for jit by default

The default is false externally but true internally at Google.
This commit is contained in:
Tobias Bosch
2017-06-09 14:00:03 -07:00
committed by Alex Rickabaugh
parent d56b7ed96d
commit 90b0713e32
11 changed files with 79 additions and 12 deletions

View File

@ -25,7 +25,7 @@ function compile(
return ngChecker.getDiagnostics();
}
fdescribe('ng type checker', () => {
describe('ng type checker', () => {
let angularFiles = setup();
function accept(...files: MockDirectory[]) {

View File

@ -261,5 +261,52 @@ describe('compiler-cli', () => {
})
.catch(e => done.fail(e));
});
it('should not produce ngsummary files by default', (done) => {
writeConfig(`{
"extends": "./tsconfig-base.json",
"files": ["mymodule.ts"]
}`);
write('mymodule.ts', `
import {NgModule} from '@angular/core';
@NgModule()
export class MyModule {}
`);
main({p: basePath})
.then((exitCode) => {
expect(exitCode).toEqual(0);
expect(fs.existsSync(path.resolve(outDir, 'mymodule.ngsummary.js'))).toBe(false);
done();
})
.catch(e => done.fail(e));
});
it('should produce ngsummary files if configured', (done) => {
writeConfig(`{
"extends": "./tsconfig-base.json",
"files": ["mymodule.ts"],
"angularCompilerOptions": {
"enableSummariesForJit": true
}
}`);
write('mymodule.ts', `
import {NgModule} from '@angular/core';
@NgModule()
export class MyModule {}
`);
main({p: basePath})
.then((exitCode) => {
expect(exitCode).toEqual(0);
expect(fs.existsSync(path.resolve(outDir, 'mymodule.ngsummary.js'))).toBe(true);
done();
})
.catch(e => done.fail(e));
});
});
});