stoat-for-desktop/js-lingui-solid/packages/babel-plugin-lingui-macro/test/js-select.test.ts

35 lines
855 B
TypeScript

import { macroTester } from "./macroTester"
macroTester({
cases: [
{
name: "Nested macros",
code: `
import { select, plural } from '@lingui/core/macro'
select(gender, {
"male": plural(numOfGuests, {
one: "He invites one guest",
other: "He invites # guests"
}),
female: \`She is \${gender}\`,
other: \`They is \${gender}\`
});
`,
},
{
name: "Nested macros with pure expressions option",
code: `
import { select, plural } from '@lingui/core/macro'
select(gender, {
"male": plural(numOfGuests, {
one: "He invites one guest",
other: "He invites # guests"
}),
female: \`She is \${gender}\`,
other: someOtherExp
});
`,
},
],
})