Skip to content
Myr

html.test.ts

This file

Path

src/utils/html.test.ts

16 lines · 529 bytes · TypeScript

Last changed by

refactor(`utils/html`): remove `escape` function (#450)Yusuke Wadabefore adoptiona7ad89c

History of this file

Take it

refactor(`utils/html`): remove `escape` function (#450)Yusuke Wadabefore adoptiona7ad89c

line 1why, one step back
1import { escapeToBuffer } from './html'

refactor(`utils/html`): rename `Buffer` to `StringBuffer` (#449)Yusuke Wadabefore adoption9f2a270

line 2why, one step back
2import type { StringBuffer } from './html'

Merge pull request #306 from honojs/feat/jsxYusuke Wadabefore adoption583d3d4

line 3why, one step back
3

perf(jsx): JSX performance improvement (#444)Taku Amanobefore adoption85cbf3e

lines 4–6why, one step back
4describe('HTML utilities', () => {
5 describe('escapeToBuffer', () => {6 it('Should escape special characters', () => {

refactor(`utils/html`): rename `Buffer` to `StringBuffer` (#449)Yusuke Wadabefore adoption9f2a270

line 7why, one step back
7 let buffer: StringBuffer = ['']

perf(jsx): JSX performance improvement (#444)Taku Amanobefore adoption85cbf3e

lines 8–14why, one step back
8 escapeToBuffer('I <b>think</b> this is good.', buffer)
9 expect(buffer[0]).toBe('I &lt;b&gt;think&lt;/b&gt; this is good.')1011 buffer = ['']12 escapeToBuffer('John "Johnny" Smith', buffer)13 expect(buffer[0]).toBe('John &quot;Johnny&quot; Smith')14 })

Merge pull request #306 from honojs/feat/jsxYusuke Wadabefore adoption583d3d4

lines 15–16why, one step back
15 })
16})