Skip to content

Commit

Permalink
⭐new(test): add test case for PR kazupon#481
Browse files Browse the repository at this point in the history
  • Loading branch information
Raiondesu committed Dec 16, 2018
1 parent 51af236 commit b08f98d
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion test/unit/silent.test.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,49 @@
describe('silent', () => {
it('should be suppressed translate warnings', () => {
it('should suppress translate warnings', () => {
const vm = new Vue({
i18n: new VueI18n({
locale: 'en',

silentTranslationWarn: true,
messages: {
en: { who: 'root' },
ja: { who: 'ルート' }
},

dateTimeFormats: {
'en': {
short: {
year: '2-digit',
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: 'numeric'
},
human: {
year: 'numeric',
month: 'long',
day: 'numeric',
hour: 'numeric',
minute: 'numeric'
}
}
},
numberFormats: {
'en': {
test: {
style: 'currency',
currency: 'USD',
currencyDisplay: 'name'
}
}
}
})
})

const spy = sinon.spy(console, 'warn')
vm.$t('foo.bar.buz')
vm.$d(1545001459635, 'short')
vm.$n(12, 'test')
assert(spy.notCalled === true)

// change
Expand Down

0 comments on commit b08f98d

Please sign in to comment.