Skip to content

Commit

Permalink
Merge pull request #37 from thorsent/suport-mocha-cakes
Browse files Browse the repository at this point in the history
Add mocha-cakes-2 support
  • Loading branch information
levibuzolic committed Oct 13, 2022
2 parents 9887bd1 + d0ae9e8 commit 2414e06
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rules/no-only-tests.js
Expand Up @@ -10,7 +10,7 @@
//------------------------------------------------------------------------------

const defaultOptions = {
block: ['describe', 'it', 'context', 'test', 'tape', 'fixture', 'serial'],
block: ['describe', 'it', 'context', 'test', 'tape', 'fixture', 'serial', 'Feature', 'Scenario', 'Given', 'And', 'When', 'Then'],
focus: ['only'],
fix: false,
};
Expand Down
36 changes: 36 additions & 0 deletions tests.js
Expand Up @@ -158,6 +158,42 @@ ruleTester.run('no-only-tests', rules['no-only-tests'], {
output: 'testResource.only("A test resource block", function() {});',
errors: [{message: 'testResource.only not permitted'}],
},
{
options: [{fix: true}],
code: 'Feature.only("Some Feature", function() {});',
output: 'Feature("Some Feature", function() {});',
errors: [{message: 'Feature.only not permitted'}],
},
{
options: [{fix: true}],
code: 'Scenario.only("Some Scenario", function() {});',
output: 'Scenario("Some Scenario", function() {});',
errors: [{message: 'Scenario.only not permitted'}],
},
{
options: [{fix: true}],
code: 'Given.only("Some assertion", function() {});',
output: 'Given("Some assertion", function() {});',
errors: [{message: 'Given.only not permitted'}],
},
{
options: [{fix: true}],
code: 'And.only("Some assertion", function() {});',
output: 'And("Some assertion", function() {});',
errors: [{message: 'And.only not permitted'}],
},
{
options: [{fix: true}],
code: 'When.only("Some assertion", function() {});',
output: 'When("Some assertion", function() {});',
errors: [{message: 'When.only not permitted'}],
},
{
options: [{fix: true}],
code: 'Then.only("Some assertion", function() {});',
output: 'Then("Some assertion", function() {});',
errors: [{message: 'Then.only not permitted'}],
},
],
});

Expand Down

0 comments on commit 2414e06

Please sign in to comment.