import { expect, tap } from '@pushrocks/tapbundle'; import * as smartmarkdown from '../ts/index'; let smartMarkdownInstance: smartmarkdown.SmartMarkdown; tap.test('should create a valid instance of SmartMarkdown', async () => { smartMarkdownInstance = new smartmarkdown.SmartMarkdown(); expect(smartMarkdownInstance).to.be.instanceOf(smartmarkdown.SmartMarkdown); }); tap.test('should convert a markdown string to html', async () => { const markdownString = '# Hi!'; const htmlString = await smartMarkdownInstance.markdownToHtml(markdownString); expect(htmlString).to.equal('

Hi!

\n'); }); tap.test('should convert a html string to markdown', async () => { const htmlString = '

Hi!

\n

This is it!

'; const markdownString = smartMarkdownInstance.htmlToMarkdown(htmlString); console.log(markdownString); }); tap.start();