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

Only skip current suite if error in beforeEach or beforeAll [Fix #581] #664

Closed
wants to merge 6 commits into from

Conversation

dansitu
Copy link

@dansitu dansitu commented Nov 20, 2012

A failed beforeEach or beforeAll hook will now only cause the current suite to be skipped, rather than terminating the entire run.

Fix for #581

@tj
Copy link
Contributor

tj commented Nov 29, 2012

this seems to mostly work, however if you have a beforeEach the nested suites will still execute beforeEach, even though a parent one has failed, ill see if i can get that working quickly here

@dansitu
Copy link
Author

dansitu commented Nov 29, 2012

Oops - sorry, good catch.

On Nov 28, 2012, at 4:08 PM, TJ Holowaychuk notifications@github.com wrote:

this seems to mostly work, however if you have a beforeEach the nested suites will still execute beforeEach, even though a parent one has failed, ill see if i can get that working quickly here


Reply to this email directly or view it on GitHub.

@piuccio
Copy link

piuccio commented Mar 20, 2013

@dansitu Any update on this pull request?

I'm having an issue writing my custom reporter because when there's an error inside hooks, the runner doesn't emit the hook end event.

@dansitu
Copy link
Author

dansitu commented Mar 20, 2013

I was in a hurry and didn't have time to make the fix @visionmedia suggested. @piuccio, maybe you'll have better luck?

@piuccio
Copy link

piuccio commented Mar 20, 2013

I'll see if I can work on it

@nbrownus
Copy link

Any reason to not just blow away the children suites of the current suite when failHook is called?

Runner.prototype.failHook = function(hook, err){
  this.fail(hook, err);
  this.suites.suite = [];
  this.emit('hook end', hook);
 };

This solves for the issue with beforeEach and nested suites.

@travisjeffery
Copy link
Contributor

fixed by #1043

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.

5 participants