fix(compiler): correctly detect when to serialze summary metadata (#20668)

The change to improve error messages broke the summary serialization
of summaries.

PR Close #20668
This commit is contained in:
Chuck Jazdzewski
2017-11-28 11:20:30 -08:00
committed by Miško Hevery
parent add5953aa1
commit 8bb42df47e
2 changed files with 39 additions and 3 deletions

View File

@ -430,5 +430,41 @@ export function main() {
importAs: symbolCache.get('someFile.ngfactory.d.ts', 'lib_1')
}]);
});
describe('with resolved symbols', () => {
it('should be able to serialize a call', () => {
init();
const serialized = serializeSummaries(
'someFile.ts', createMockOutputContext(), summaryResolver, symbolResolver, [{
symbol: symbolCache.get('/tmp/test.ts', 'main'),
metadata: {
__symbolic: 'call',
expression:
{__symbolic: 'resolved', symbol: symbolCache.get('/tmp/test2.ts', 'ref')}
}
}],
[]);
expect(serialized.json).not.toContain('error');
});
it('should be able to serialize a call to a method', () => {
init();
const serialized = serializeSummaries(
'someFile.ts', createMockOutputContext(), summaryResolver, symbolResolver, [{
symbol: symbolCache.get('/tmp/test.ts', 'main'),
metadata: {
__symbolic: 'call',
expression: {
__symbolic: 'select',
expression:
{__symbolic: 'resolved', symbol: symbolCache.get('/tmp/test2.ts', 'ref')},
name: 'foo'
}
}
}],
[]);
expect(serialized.json).not.toContain('error');
});
});
});
}