Skip to content
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

Fix error when there is rule keyword #286

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jimmyko
Copy link

@jimmyko jimmyko commented Apr 6, 2023

This PR is to fix below error when the feature file contains statement with Rule keyword

/Users/jimmyko/github/gherkin-lint/dist/rules/keywords-in-logical-order.js:17
    node.steps.forEach(step => {
         ^

TypeError: Cannot read properties of null (reading 'steps')
    at /Users/jimmyko/github/gherkin-lint/dist/rules/keywords-in-logical-order.js:17:10
    at Array.forEach (<anonymous>)
    at Object.run (/Users/jimmyko/github/gherkin-lint/dist/rules/keywords-in-logical-order.js:13:20)
    at /Users/jimmyko/github/gherkin-lint/dist/rules.js:46:26
    at Array.forEach (<anonymous>)
    at Object.runAllEnabledRules (/Users/jimmyko/github/gherkin-lint/dist/rules.js:41:22)
    at readAndParseFile.then.perFileErrors (/Users/jimmyko/github/gherkin-lint/dist/linter.js:74:29)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)

@jimmyko
Copy link
Author

jimmyko commented Apr 6, 2023

@vsiakka please kindly review this PR. This will fix the bug which is the only blocker for me using this in the project I'm working

@andrewnicols
Copy link
Member

Hi @jimmyko,

Can you please rebase this change and provide a unit test.

@gesysver
Copy link

Hi there! Just bumped into this issue myself. Hope this PR to be merged soon :)

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.

None yet

3 participants