Skip to content

Commit

Permalink
adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmiceli committed Jul 18, 2024
1 parent e2af299 commit 634cb5b
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions eslint-plugin-expensify/tests/use-periods-error-messages.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,48 @@ const ruleTester = new RuleTester({
},
});

const goodExample = `
const goodExampleSingleSentence = `
error: {
testMessage: 'This is a test message'
}
`;

const goodExampleMultipleSentences = `
error: {
testMessage: 'This is a test message. Last period is mandatory.'
}
`;

const badExampleSingleSentence = `
error: {
testMessage: 'This is a test message.'
}
`;

const badExample = `
const badExampleMultipleSentences = `
error: {
testMessage: 'This is a test message'
testMessage: 'This is a test message. Last period is mandatory'
}
`;

ruleTester.run('use-periods-for-error-messages', rule, {
valid: [
{
code: goodExample,
code: goodExampleSingleSentence,
},
{
code: goodExampleMultipleSentences,
},
],
invalid: [
{
code: badExample,
code: badExampleSingleSentence,
errors: [{
message,
}],
},
{
code: badExampleMultipleSentences,
errors: [{
message,
}],
Expand Down

0 comments on commit 634cb5b

Please sign in to comment.