Skip to content

Commit 66a7431

Browse files
committed
test: interpolation custom regex
1 parent 22889dd commit 66a7431

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

test/__snapshots__/interpolation.test.ts.snap

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ exports[`should match snapshots 1`] = `
44
[
55
"Hello, u3u (0)",
66
"Hello, u3u ({count})",
7+
"Hello, qwq.",
78
"蔡徐坤 你好,我今年 18 岁,我的爱好是 唱,跳,rap,篮球 。",
89
]
910
`;

test/interpolation.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ it('should match snapshots', () => {
1616
},
1717
}),
1818

19+
interpolation('Hello, {{name}}.', {
20+
regex: /\{\{(.*?)\}\}/gu,
21+
22+
values: {
23+
name: 'qwq',
24+
},
25+
}),
26+
1927
interpolation('{name} 你好,我今年 {age} 岁,我的爱好是 {hobby} 。', {
2028
values: {
2129
age: 18,

0 commit comments

Comments
 (0)