wip(ssr): ssr helper codegen
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import { escapeHtml, interpolate } from '../src'
|
||||
import { _interpolate } from '../src'
|
||||
import { escapeHtml } from '@vue/shared'
|
||||
|
||||
test('ssr: interpolate', () => {
|
||||
expect(interpolate(0)).toBe(`0`)
|
||||
expect(interpolate(`foo`)).toBe(`foo`)
|
||||
expect(interpolate(`<div>`)).toBe(`<div>`)
|
||||
expect(_interpolate(0)).toBe(`0`)
|
||||
expect(_interpolate(`foo`)).toBe(`foo`)
|
||||
expect(_interpolate(`<div>`)).toBe(`<div>`)
|
||||
// should escape interpolated values
|
||||
expect(interpolate([1, 2, 3])).toBe(
|
||||
expect(_interpolate([1, 2, 3])).toBe(
|
||||
escapeHtml(JSON.stringify([1, 2, 3], null, 2))
|
||||
)
|
||||
expect(
|
||||
interpolate({
|
||||
_interpolate({
|
||||
foo: 1,
|
||||
bar: `<div>`
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user