Skip to content

Commit

Permalink
Message settings test
Browse files Browse the repository at this point in the history
  • Loading branch information
stevelacey committed Jan 12, 2020
1 parent b35bc14 commit 1ad0dd3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/lib/rules/no-missing-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ const settings = {
}
}

const messageSettings = {
'vue-i18n': {
locale: 'en',
messages: { en: { hello: 'hello world' }},
}
}

const tester = new RuleTester({
parser: require.resolve('vue-eslint-parser'),
parserOptions: { ecmaVersion: 2015 }
Expand Down Expand Up @@ -60,6 +67,10 @@ tester.run('no-missing-keys', rule, {
code: `<template>
<p v-t="'hello'"></p>
</template>`
}, {
// using message settings
settings: messageSettings,
code: `$t('hello')`
}],

invalid: [{
Expand Down Expand Up @@ -118,5 +129,12 @@ tester.run('no-missing-keys', rule, {
`'missing.path' does not exist`,
`'missing.path' does not exist`
]
}, {
// using message settings
settings: messageSettings,
code: `$t('missing')`,
errors: [
`'missing' does not exist`
]
}]
})

0 comments on commit 1ad0dd3

Please sign in to comment.