Fixed unhandled empty feature files #3046
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation/Description of the PR
When a Feature file is empty, instead of showing an error that the Feature file is empty, the below error is displayed.
This is irrelevant to the actual problem and as a result users will not understand what the problem is, thereby costing a lot of time for resolution.
TypeError: Cannot read property 'name' of undefined
at module.exports (/Users/node_modules/codeceptjs/lib/interfaces/gherkin.js:18:39)
at /Users/node_modules/codeceptjs/lib/mochaFactory.js:38:32
at Array.map ()
at Mocha.mocha.loadFiles (/Users/node_modules/codeceptjs/lib/mochaFactory.js:36:21)
at Mocha.run (/Users/node_modules/codeceptjs/node_modules/mocha/lib/mocha.js:966:10)
at /Users/node_modules/codeceptjs/lib/codecept.js:188:15
at new Promise ()
at Codecept.run (/Users/node_modules/codeceptjs/lib/codecept.js:171:12)
at Function.run (/Users/lib/utils/runner.util.ts:27:18)
at main (/Users/lib/runner.ts:6:10)
Applicable helpers: Applies to all helpers
Applicable plugins:
Type of change
Checklist:
npm run docs
)npm run lint
)npm test
)