build(aio): left align code regions

This commit is contained in:
Peter Bacon Darwin
2017-03-27 08:57:23 +01:00
committed by Pete Bacon Darwin
parent 5e3ef775d5
commit 52ea193638
2 changed files with 23 additions and 1 deletions

View File

@ -43,6 +43,17 @@ describe('regionParser service', () => {
expect(output.contents).toEqual(t('abc', 'def', 'ghi'));
});
it('should left align the text of the region', () => {
const output = regionParser(
t(
'/* #docregion X */', ' all', ' indented', ' by', ' two', ' spaces', '/* #enddocregion X */',
'/* #docregion Y */', ' first', ' line', ' indented', ' more', ' than', ' later', ' lines', '/* #enddocregion Y */',
'/* #docregion Z */', ' ignore', ' ', ' empty', '', ' lines', '/* #enddocregion Z */'
), 'test-type');
expect(output.regions['X']).toEqual(t('all', ' indented', ' by', 'two', 'spaces'));
expect(output.regions['Y']).toEqual(t(' first', 'line', 'indented', ' more', 'than', 'later', 'lines'));
expect(output.regions['Z']).toEqual(t('ignore', '', 'empty', '', 'lines'));
});
it('should remove doc plaster annotations from the contents', () => {
const output =