forked from FoundKeyGang/FoundKey
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:
parent
9b7a0b574e
commit
2c24f8a9ef
1 changed files with 4 additions and 5 deletions
|
@ -1,20 +1,19 @@
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
import * as mfm from 'mfm-js';
|
|
||||||
|
|
||||||
import { toHtml } from '../src/mfm/to-html.js';
|
import { toHtml } from '../src/mfm/to-html.js';
|
||||||
import { fromHtml } from '../src/mfm/from-html.js';
|
import { fromHtml } from '../src/mfm/from-html.js';
|
||||||
|
|
||||||
describe('toHtml', () => {
|
describe('toHtml', () => {
|
||||||
it('br', () => {
|
it('br', async () => {
|
||||||
const input = 'foo\nbar\nbaz';
|
const input = 'foo\nbar\nbaz';
|
||||||
const output = '<p><span>foo<br>bar<br>baz</span></p>';
|
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 input = 'foo\r\nbar\rbaz';
|
||||||
const output = '<p><span>foo<br>bar<br>baz</span></p>';
|
const output = '<p><span>foo<br>bar<br>baz</span></p>';
|
||||||
assert.equal(toHtml(mfm.parse(input)), output);
|
assert.equal(await toHtml(input), output);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue