Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

More informative errors #214

Closed
charlierudolph opened this issue May 31, 2016 · 0 comments
Closed

More informative errors #214

charlierudolph opened this issue May 31, 2016 · 0 comments

Comments

@charlierudolph
Copy link
Contributor

The errors thrown by aren't very useful. It'd be nice if they could be a bit smarter in specific cases.

Error thrown from a tag on a background

/home/bricas/site-tests/node_modules/cucumber/lib/cucumber/parser.js:21
          throw e;
          ^
CompositeParserException: Parser errors:
(4:3): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'Background: Override Page Load Timeout'
(5:5): expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'Given I set pageLoadTimeout to 30000'
path: /home/bricas/site-tests/features/core/authentication-proxy.feature
    at ...

It'd be much nicer if we could say something like tags are not allowed on Background.

Error thrown for two features in a single file

/Users/charlesrudolph/github/cucumber-js/lib/cucumber/parser.js:21
          throw e;
          ^
CompositeParserException: Parser errors:
(53:1): expected: #EOF, #StepLine, #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'Feature: compilers2'
(54:3): expected: #EOF, #StepLine, #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'In order to use the JS dialect I'm most comfortable with'
(55:3): expected: #EOF, #StepLine, #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'As a step definition implementor'
(56:3): expected: #EOF, #StepLine, #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'I want to use any compiler to write my step definitions in'
(58:3): expected: #EOF, #StepLine, #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'Background:'
path: /Users/charlesrudolph/github/cucumber-js/features/compiler.feature
    at ...

it would be nice to say, cannot have multiple features in a single file

We won't be able to handle all errors but would be nice to give slowly build up move informative errors.

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

No branches or pull requests

2 participants