Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
81 additions
and
40 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
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('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