1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

added unit tests for lib/markdown

This commit is contained in:
Yu-Hung Ou
2018-03-11 23:18:35 +11:00
parent bbcd674516
commit 1af374439d
4 changed files with 124 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import test from 'ava'
import Markdown from 'browser/lib/markdown'
import markdownFixtures from '../fixtures/markdowns'
// basic markdown instance which meant to be used in every test cases.
// To test markdown options, initialize a new instance in your test case
const md = new Markdown()
test('Markdown.render() should renders markdown correctly', t => {
const rendered = md.render(markdownFixtures.basic)
t.snapshot(rendered)
})
test('Markdown.render() should renders codeblock correctly', t => {
const rendered = md.render(markdownFixtures.codeblock)
t.snapshot(rendered)
})
test('Markdown.render() should renders KaTeX correctly', t => {
const rendered = md.render(markdownFixtures.katex)
t.snapshot(rendered)
})