backend: make toHtml tests async

PRs #84, #134, and #136 changed toHtml to be async, but the test was not
updated to reflect that.
This commit is contained in:
Norm 2022-09-12 16:30:29 -04:00 committed by Gitea
parent 9b7a0b574e
commit 2c24f8a9ef

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);
});
});