Skip to content

Commit

Permalink
add test case for modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Jun 20, 2022
1 parent 53453d4 commit e94386a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/vue-i18n-core/test/composer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,25 @@ describe('modifiers', () => {
expect(modifiers).toEqual(_modifiers)
expect(t('hi')).toEqual('hi hello-world')
})

test('pascal case', () => {
const _modifiers = {
snakeCase: (str: VueMessageType) =>
isString(str) ? str.split(' ').join('-') : str
}
const { modifiers, t } = createComposer({
locale: 'en',
messages: {
en: {
address: 'home Address',
snakeAddress: '@.snakeCase:address'
}
},
modifiers: _modifiers
})
expect(modifiers).toEqual(_modifiers)
expect(t('snakeAddress')).toEqual('home-Address')
})
})

describe('pluralRules', () => {
Expand Down

0 comments on commit e94386a

Please sign in to comment.