Skip to content

Commit

Permalink
feat: use static catalog on configure
Browse files Browse the repository at this point in the history
  • Loading branch information
lykmapipo committed Jun 20, 2020
1 parent c0d5343 commit e6679aa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/unit/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,21 @@ describe('i18n', () => {
expect(locales).to.exist.and.be.an('object');
});

it('should use static catalog', () => {
const i18n = configure({
reset: true,
staticCatalog: {
en: { salute: 'Hello' },
sw: { salute: 'Mambo' },
},
});

expect(i18n.t('salute')).to.exist.and.be.equal('Hello');
expect(i18n.t({ phrase: 'salute', locale: 'sw' })).to.exist.and.be.equal(
'Mambo'
);
});

after(() => {
process.env.BASE_PATH = BASE_PATH;
process.env.I18N_LOCALES = I18N_LOCALES;
Expand Down

0 comments on commit e6679aa

Please sign in to comment.