0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00

Add some tests for mustache span syntax

Also refactored test files a bit
This commit is contained in:
Alexey Sachkov
2021-12-30 23:23:44 +03:00
parent ccca313a15
commit 01bceca7df
2 changed files with 130 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
/* eslint-disable max-lines */
const Markdown = require('naturalcrit/markdown.js');
test('Escapes <script> tag', function() {
const source = '<script></script>';
const rendered = Markdown.render(source);
expect(rendered).toMatch('&lt;script&gt;&lt;/script&gt;');
});
test('Processes the markdown within an HTML block if its just a class wrapper', function() {
const source = '<div>*Bold text*</div>';
const rendered = Markdown.render(source);
expect(rendered).toBe('<div> <p><em>Bold text</em></p>\n </div>');
});