mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-02-06 17:38:55 +01:00
Move test-specific code into the testing function.
This commit is contained in:
parent
fd17ffecfb
commit
1e9cdbafd4
@ -174,7 +174,8 @@ export function parseHTMLBody(platform, mediaRepository, html) {
|
|||||||
|
|
||||||
import parse from '../../../../../lib/node-html-parser/index.js';
|
import parse from '../../../../../lib/node-html-parser/index.js';
|
||||||
|
|
||||||
export class HTMLParseResult {
|
export function tests() {
|
||||||
|
class HTMLParseResult {
|
||||||
constructor(bodyNode) {
|
constructor(bodyNode) {
|
||||||
this._bodyNode = bodyNode;
|
this._bodyNode = bodyNode;
|
||||||
}
|
}
|
||||||
@ -216,9 +217,8 @@ const platform = {
|
|||||||
parseHTML: (html) => new HTMLParseResult(parse(html))
|
parseHTML: (html) => new HTMLParseResult(parse(html))
|
||||||
};
|
};
|
||||||
|
|
||||||
export function tests() {
|
|
||||||
function test(assert, input, output) {
|
function test(assert, input, output) {
|
||||||
assert.deepEqual(parseHTMLBody({ mediaRepository: null, platform }, input), new MessageBody(input, output));
|
assert.deepEqual(parseHTMLBody(platform, null, input), new MessageBody(input, output));
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user