const renderMarkdownFactory = require('./renderMarkdown'); describe('rho: renderMarkdown service', () => { let renderMarkdown; beforeEach(() => { renderMarkdown = renderMarkdownFactory(); }); it('should convert markdown to HTML', () => { const content = '# heading 1\n' + '\n' + 'A paragraph with *bold* and _italic_.\n' + '\n' + '* List item 1\n' + '* List item 2'; const output = renderMarkdown(content); expect(output).toEqual( '
A paragraph with bold and italic.
\n' + 'A paragraph.
\n' + 'Another paragraph
'); }); it('should not format the contents of tags marked as unformatted ', () => { renderMarkdown.unformattedTags = ['code-example']; const content = '