vue3-yuanma/packages/shared/__tests__/escapeHtml.spec.ts

12 lines
404 B
TypeScript
Raw Normal View History

import { escapeHtml } from '../src'
test('ssr: escapeHTML', () => {
expect(escapeHtml(`foo`)).toBe(`foo`)
expect(escapeHtml(true)).toBe(`true`)
expect(escapeHtml(false)).toBe(`false`)
expect(escapeHtml(`a && b`)).toBe(`a && b`)
expect(escapeHtml(`"foo"`)).toBe(`"foo"`)
expect(escapeHtml(`'bar'`)).toBe(`'bar'`)
expect(escapeHtml(`<div>`)).toBe(`&lt;div&gt;`)
})