Skip to content

Commit eb94d8a

Browse files
committed
add no escape test case
1 parent 75c178c commit eb94d8a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/core-base/test/translate.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,23 @@ describe('escapeParameter', () => {
681681
translate(ctx, 'hello', ['<b>kazupon</b>'], { escapeParameter: true })
682682
).toEqual('hello, &lt;b&gt;kazupon&lt;/b&gt;!')
683683
})
684+
685+
test('no escape', () => {
686+
const ctx = context({
687+
locale: 'en',
688+
warnHtmlMessage: false,
689+
escapeParameter: false,
690+
messages: {
691+
en: {
692+
hello: 'hello, {name}!'
693+
}
694+
}
695+
})
696+
697+
expect(translate(ctx, 'hello', { name: '<b>kazupon</b>' })).toEqual(
698+
'hello, <b>kazupon</b>!'
699+
)
700+
})
684701
})
685702

686703
describe('error', () => {

0 commit comments

Comments
 (0)