Skip to content
Myr

html.test.ts

This file

Path

src/utils/html.test.ts

8 lines · 302 bytes · TypeScript

Last changed by

refactor(html): make `html` as middleware (#319)Yusuke Wadabefore adoption5976a60

History of this file

Take it

refactor(html): make `html` as middleware (#319)Yusuke Wadabefore adoption5976a60

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

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

lines 2–8why, one step back
2
3describe('HTML escape', () => {4 it('Should escape special characters', () => {5 expect(escape('I <b>think</b> this is good.')).toBe('I &lt;b&gt;think&lt;/b&gt; this is good.')6 expect(escape('John "Johnny" Smith')).toBe('John &quot;Johnny&quot; Smith')7 })8})