Skip to content

Fixed unhandled empty feature files #3046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 20, 2021
Merged

Fixed unhandled empty feature files #3046

merged 1 commit into from
Sep 20, 2021

Conversation

abhimanyupandian
Copy link
Contributor

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

  • WebDriver
  • Puppeteer
  • Nightmare
  • REST
  • FileHelper
  • Appium
  • Protractor
  • TestCafe
  • Playwright

Applicable plugins:

  • allure
  • autoDelay
  • autoLogin
  • customLocator
  • pauseOnFail
  • coverage
  • retryFailedStep
  • screenshotOnFail
  • selenoid
  • stepByStepReport
  • wdio
  • subtitles

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

@abhimanyupandian
Copy link
Contributor Author

@DavertMik Could you please review and merge this?

Copy link
Member

@Arhell Arhell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Arhell Arhell requested a review from DavertMik September 19, 2021 00:57
@DavertMik
Copy link
Contributor

Thanks! Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants