Skip to content

Commit

Permalink
Test addition of custom message for valid-suite-description rule
Browse files Browse the repository at this point in the history
  • Loading branch information
BourgoisMickael committed Aug 21, 2019
1 parent b7d7682 commit dc7334c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/rules/valid-suite-description.js
Expand Up @@ -26,6 +26,26 @@ ruleTester.run('valid-suite-description', rules['valid-suite-description'], {
options: [ '^[A-Z]', [ 'someFunction' ] ],
code: 'someFunction("Should do something", function () { });'
},
{
options: [ '^[A-Z]', [ 'someFunction' ], 'some error message' ],
code: 'someFunction("Should do something", function () { });'
},
{
options: [ /^[A-Z]/, [ 'someFunction' ], 'some error message' ],
code: 'someFunction("Should do something", function () { });'
},
{
options: [ { pattern: '^[A-Z]', suiteNames: [ 'someFunction' ], message: 'some error message' } ],
code: 'someFunction("Should do something", function () { });'
},
{
options: [ { pattern: /^[A-Z]/, suiteNames: [ 'someFunction' ], message: 'some error message' } ],
code: 'someFunction("Should do something", function () { });'
},
{
options: [ {} ],
code: 'someFunction("Should do something", function () { });'
},
'someOtherFunction();',
{
parserOptions: { ecmaVersion: 2017 },
Expand Down Expand Up @@ -63,6 +83,20 @@ ruleTester.run('valid-suite-description', rules['valid-suite-description'], {
errors: [
{ message: 'Invalid "customFunction()" description found.' }
]
},
{
options: [ '^[A-Z]', [ 'customFunction' ], 'some error message' ],
code: 'customFunction("this is a test", function () { });',
errors: [
{ message: 'some error message' }
]
},
{
options: [ { pattern: '^[A-Z]', suiteNames: [ 'customFunction' ], message: 'some error message' } ],
code: 'customFunction("this is a test", function () { });',
errors: [
{ message: 'some error message' }
]
}
]
});

0 comments on commit dc7334c

Please sign in to comment.