From ab6650ed37a43699473e423d0f1a4c836ab97ad4 Mon Sep 17 00:00:00 2001 From: Fede Date: Thu, 24 Dec 2020 19:21:02 -0300 Subject: [PATCH] test: add tests --- lib/utility/html.test.ts | 42 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/lib/utility/html.test.ts b/lib/utility/html.test.ts index 5d00282d..5e7e836c 100644 --- a/lib/utility/html.test.ts +++ b/lib/utility/html.test.ts @@ -1,4 +1,4 @@ -import { split } from './html' +import { split, HTML } from './html' test('utility/html.split', () => { const LOREM_IPSU = `Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.` @@ -30,3 +30,43 @@ test('utility/html.split', () => { "it to make a type specimen book.", ]) }) + + +describe('lib/utility/html#HTML', () => { + test('.code', () => { + const html = new HTML + expect(html.code('CODE')).toBe('CODE
') + }) + + test('.highlight', () => { + const html = new HTML + expect(html.highlight('CODE')).toBe('CODE') + }) + + test('.sup', () => { + const html = new HTML + expect(html.sup('CODE')).toBe(' CODE') + }) + + test('.line', () => { + const html = new HTML + expect(html.index).toBe(1) + expect(html.line('CODE')).toBe('1CODE') + expect(html.index).toBe(2) + }) + + test('.tab', () => { + const html = new HTML + expect(html.tab('CODE')).toBe('CODE') + }) + + test('.keyword', () => { + const html = new HTML + expect(html.keyword('CODE')).toBe('CODE') + }) + + test('.comment', () => { + const html = new HTML + expect(html.comment('CODE')).toBe('# CODE') + }) +}) \ No newline at end of file