mocha-gherkin icon indicating copy to clipboard operation
mocha-gherkin copied to clipboard

this.listener[event] is not a function

Open vinilnarayan opened this issue 5 years ago • 1 comments

Hi, After installing the same using npm, while trying to execute "cat sample.feature | ./node_modules/.bin/mocha-gherkin > test.js" getting error like

/cucumberMocha/testProj/node_modules/gherkin/lib/gherkin/lexer/en.j s:960 this.listener[event](this.keyword, name, description, this.current_line); ^ TypeError: this.listener[event] is not a function at Lexer.store_keyword_content (/cucumberMocha/testProj/node_mo dules/gherkin/lib/gherkin/lexer/en.js:960:23)

Thanks in advance....

vinilnarayan avatar Feb 24 '20 13:02 vinilnarayan

I was using 'Scenario Outline' instead of 'Scenario' in my feature file and i have some example part also. So that only i have received that error. When I remove example and changed as 'Scenario', then its works good.

Also I'm using 'Background' part in my feature. How I can able to mitigate this changes ? eg: **Feature: BasicBooking Background: Login as guest Given I log into the application as guest And I wait for 10s

Scenario Outline: Booking a sample ticket Then I click on 'submit' button And I press 'ok' button

Scenario Outline: Booking a complex ticket Then I click on 'adult' button And I press 'add' button Then I click on 'submit' button And I press 'ok' button**

  1. Scenario Outline should consider.
  2. Example part should take (optional).
  3. Background should include.

vinilnarayan avatar Feb 24 '20 14:02 vinilnarayan