0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-29 04:42:41 +00:00

Initial commit with jest enabling

Removed dependency on pico-check and existing tests.
Added jest as dev dependency, introduced minimal configuration for it.
Added a very first couple of tests for our markdown parser/renderer.
This commit is contained in:
Alexey Sachkov
2021-12-30 22:41:01 +03:00
parent c463eedc50
commit ccca313a15
4 changed files with 21 additions and 13 deletions

13
tests/markdown.test.js Normal file
View File

@@ -0,0 +1,13 @@
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>');
});