CoolFace
Apppublic

Umama-at-Bluchip/Quick-UI

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
tests.js26 linesDownload Raw Back to test
1'use strict';2 3var data = {4	anchor: { arg: 'bar"baz"', expected: '<a name="bar&quot;baz&quot;">foo</a>' },5	big: '<big>foo</big>',6	blink: '<blink>foo</blink>',7	bold: '<b>foo</b>',8	fixed: '<tt>foo</tt>',9	fontcolor: { arg: 'blue"red"green', expected: '<font color="blue&quot;red&quot;green">foo</font>' },10	fontsize: { arg: '10"large"small', expected: '<font size="10&quot;large&quot;small">foo</font>' },11	italics: '<i>foo</i>',12	link: { arg: 'url"http://"', expected: '<a href="url&quot;http://&quot;">foo</a>' },13	small: '<small>foo</small>',14	strike: '<strike>foo</strike>',15	sub: '<sub>foo</sub>',16	sup: '<sup>foo</sup>'17};18 19module.exports = function (method, name, t) {20	var result = data[name] || {};21	var expected = typeof result === 'string' ? result : result.expected;22	var actual = typeof result === 'string' ? method('foo') : method('foo', result.arg);23 24	t.equal(actual, expected, name + ': got expected result');25};26