Skip to content

Commit 38ccf3a

Browse files
author
Sergio Moreno
committed
chore: added t macro test
1 parent a7cb764 commit 38ccf3a

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

packages/macro/test/js-t.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,24 @@ export default [
144144
});
145145
`,
146146
},
147+
{
148+
name: "Support id with message interpolation",
149+
input: `
150+
import { t } from '@lingui/macro'
151+
const msg = t({ id: 'msgId', message: \`Some \${value}\` })
152+
`,
153+
expected: `import { i18n } from "@lingui/core";
154+
const msg =
155+
i18n._(/*i18n*/
156+
{
157+
id: "msgId",
158+
message: "Some {value}",
159+
values: {
160+
value: value,
161+
},
162+
});
163+
`,
164+
},
147165
{
148166
name: "Newlines after continuation character are removed",
149167
filename: "js-t-continuation-character.js",

0 commit comments

Comments
 (0)