Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add all-rules tests which verify that none of the rules crashes whe…
…n it parses a test file that's missing some feature properties.\n- Fix a couple of rules that broke when parsing such features\n- Remove individual rule tests checking agains an empty feature file
- Loading branch information
Showing
21 changed files
with
89 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,12 @@ | |
} | ||
} | ||
] | ||
] | ||
], | ||
"env": { | ||
"test": { | ||
"plugins": [ | ||
"istanbul" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Feature: This is a childless feature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Feature: Some Feature | ||
|
||
Scenario Outline: Some Scenario Outline | ||
Given this is a step | ||
|
||
Examples: |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Feature: | ||
|
||
Background: | ||
|
||
Scenario: | ||
|
||
Scenario Outline: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
var rules = require('../../../dist/rules.js'); | ||
var linter = require('../../../dist/linter.js'); | ||
|
||
// Test cases for incomplete feature files that have broken over time accross multiple rules | ||
describe.only('All rules', function() { | ||
|
||
function runAllEnabledRulesAgainstFile(featureFile) { | ||
var allRules = rules.getAllRules(); | ||
var configuration = {}; | ||
Object.keys(allRules).forEach(function(rule) { | ||
if (rule == 'new-line-at-eof') { | ||
configuration[rule] = ['on', 'yes']; | ||
} else if (rule == 'required-tags') { | ||
configuration[rule] = ['on', {'tags': [] }]; | ||
} else { | ||
configuration[rule] = 'on'; | ||
} | ||
}); | ||
|
||
const {feature, file} = linter.readAndParseFile('test/rules/all-rules/' + featureFile, 'utf8'); | ||
|
||
rules.runAllEnabledRules(feature, file, configuration); | ||
} | ||
|
||
it('do not throw exceptions when processing an empty feature', function() { | ||
runAllEnabledRulesAgainstFile('EmptyFeature.feature'); | ||
}); | ||
|
||
it('do not throw exceptions when processing a feature with no children', function() { | ||
runAllEnabledRulesAgainstFile('ChildlessFeature.feature'); | ||
}); | ||
|
||
it('do not throw exceptions when processing a feature with no steps', function() { | ||
runAllEnabledRulesAgainstFile('SteplessFeature.feature'); | ||
}); | ||
|
||
it('do not throw exceptions when processing a scenario outline with an empty examples table', function() { | ||
runAllEnabledRulesAgainstFile('EmptyExamples.feature'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters