Skip to content

Commit

Permalink
add inline html test
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Feb 12, 2020
1 parent 1b70c4a commit 11656f8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/unit/marked-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,14 @@ describe('changeDefaults', () => {
expect(require('../../src/defaults').defaults.test).toBe(true);
});
});

describe('inlineLexer', () => {
it('should send html to renderer.html', () => {
const renderer = new marked.Renderer();
spyOn(renderer, 'html').and.callThrough();
const md = 'HTML Image: <img alt="MY IMAGE" src="example.png" />';
marked(md, { renderer });

expect(renderer.html).toHaveBeenCalledWith('<img alt="MY IMAGE" src="example.png" />');
});
});

0 comments on commit 11656f8

Please sign in to comment.