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

Test fails to exit when nothing is added to the queue in a custom command #1792

Closed
justafish opened this issue May 4, 2018 · 2 comments
Closed

Comments

@justafish
Copy link
Contributor

Seen in 0.9.20 (I unsuccessfully tried to run our tests on 1.0.4 but it had dependency issues and wasn't able to find our globals file)

This should reproduce it:

exports.command = function myCommand(callback) {
  const self = this;

  try {
    throw new Error('myerror');
  }
  catch(error) {
    this.assert.fail(error);
  }

  if (typeof callback === 'function') {
    callback.call(self);
  }
  return this;
};

Which will hang like this:

[Example Test] Test Suite
=============================

Running:  Test page
 ✖ Failed [fail]: (Error: myerror)
    at Object.installDrupal (/Users/justafish/Repos/drupal/core/tests/Drupal/Nightwatch/Commands/installDrupal.js:39:17)

^C

If I add this.pause(1);, then the tests fails and exits fine.

```[Example Test] Test Suite
=============================

Running:  Test page
 ✖ Failed [fail]: (Error: lol)
    at Object.installDrupal (/Users/justafish/Repos/drupal/core/tests/Drupal/Nightwatch/Commands/installDrupal.js:39:17)


FAILED:  1 assertions failed (941ms)

 _________________________________________________

 TEST FAILURE:  1 assertions failed, 0 passed. (1.927s)

 ✖ exampleTest

   - Test page (941ms)
   Failed [fail]: (Error: myerror)
       at Object.installDrupal (/Users/justafish/Repos/drupal/core/tests/Drupal/Nightwatch/Commands/installDrupal.js:39:17)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@beatfactor
Copy link
Member

Can you please re-try with v1.0.5?

@beatfactor
Copy link
Member

Closing as due to lack of follow up.

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

No branches or pull requests

2 participants