marked-mfm/test/index.test.js
Sol Fisher Romanoff 003d398450
Initial commit
2022-07-08 11:32:20 +03:00

18 lines
641 B
JavaScript

import { marked } from 'marked'
import markedMfm from '../src/index.js'
describe('marked-mfm', () => {
beforeEach(() => {
marked.setOptions(marked.getDefaults())
})
test('inline', () => {
marked.use(markedMfm())
expect(marked('$[x2 this text is bigger]')).toBe('<p><span style="display: inline-block" class="x2">this text is bigger</span></p>\n')
})
test('nested', () => {
marked.use(markedMfm())
expect(marked('$[twitch twitch $[sparkle sparkle]]')).toBe('<p><span style="display: inline-block" class="twitch">twitch <span style="display: inline-block" class="sparkle">sparkle</span></span></p>\n')
})
})