Skip to content

Commit

Permalink
Added test case in an attempt to reproduce issue #143 (reproduction f…
Browse files Browse the repository at this point in the history
…ailed)
  • Loading branch information
jjhbw committed Aug 5, 2020
1 parent d48291b commit 4743cba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Binary file added src/__tests__/fixtures/issue143Repro.docx
Binary file not shown.
16 changes: 16 additions & 0 deletions src/__tests__/indexNode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,22 @@ Morbi dignissim consequat ex, non finibus est faucibus sodales. Integer sed just
expect(result).toMatchSnapshot();
});

it('143 new line character inside a variable does not work', async () => {
const template = await fs.promises.readFile(
path.join(__dirname, 'fixtures', 'issue143Repro.docx')
);

const wordBuffer = await createReport({
template: template,
cmdDelimiter: ['{{ ', ' }}'],
data: { address: 'City\nCountry' },
// processLineBreaks: true, // true is the default
});

fs.writeFileSync('test.docx', wordBuffer);
expect(false).toBeTruthy();
});

describe('rejectNullish setting', () => {
it('INS', async () => {
const template = await fs.promises.readFile(
Expand Down

0 comments on commit 4743cba

Please sign in to comment.