backend: fix toHtml tests #151

Merged
norm merged 1 commit from fix/backend-mfm-tests into main 2022-09-13 15:20:27 +00:00

View file

@ -1,20 +1,19 @@
import * as assert from 'assert';
import * as mfm from 'mfm-js';
import { toHtml } from '../src/mfm/to-html.js';
import { fromHtml } from '../src/mfm/from-html.js';
describe('toHtml', () => {
it('br', () => {
it('br', async () => {
const input = 'foo\nbar\nbaz';
const output = '<p><span>foo<br>bar<br>baz</span></p>';
assert.equal(toHtml(mfm.parse(input)), output);
assert.equal(await toHtml(input), output);
});
it('br alt', () => {
it('br alt', async () => {
const input = 'foo\r\nbar\rbaz';
const output = '<p><span>foo<br>bar<br>baz</span></p>';
assert.equal(toHtml(mfm.parse(input)), output);
assert.equal(await toHtml(input), output);
});
});