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

Resolve unhandled rejection in BeforeFeatures hook #797 #798

Merged
merged 9 commits into from
Apr 24, 2017

Conversation

yaronassa
Copy link

This PR resolves #792.
Currently returning a rejected promise from the BeforeFeatures hook will cause the run to:

  • Exit with code=0 (expected=1).
  • Throw a node unhandled rejection error.

@yaronassa
Copy link
Author

A linting issue with node version > 4?
The unit and feature tests seem to pass on v4 (and locally I have them passing on v6).

"""
features/support/hooks.js:2 Something bad
"""
And it does not output a valid JSON
Copy link
Member

@charlierudolph charlierudolph Mar 28, 2017

Choose a reason for hiding this comment

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

I think this step (and the related step definition) can just be removed. I don't think we gain much by having it here

Copy link
Author

@yaronassa yaronassa Mar 28, 2017

Choose a reason for hiding this comment

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

I wanted to make sure the run exits immediately without executing any scenarios.
Is there a more straightforward way to do that?

Copy link
Member

@charlierudolph charlierudolph Mar 28, 2017

Choose a reason for hiding this comment

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

I'd rather we use a step like "And it outputs no other text". The way its written now just makes we think we are somehow printing invalid json instead of printing nothing

Copy link
Author

@yaronassa yaronassa Mar 28, 2017

Choose a reason for hiding this comment

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

Yeah, you're right. I'll push an alternative that makes sure a step output isn't in stdout/stderr.

yaronassa and others added 6 commits March 28, 2017 09:25
Remove invalid JSON step
Add a shouldFind switch to the output contains text step
Change the beforeFeatures hook scenario accordingly
@charlierudolph charlierudolph merged commit 1b176a0 into cucumber:1.x Apr 24, 2017
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants