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

Allow async exec test to reject #4583

Closed
hzoo opened this issue Sep 27, 2016 · 3 comments
Closed

Allow async exec test to reject #4583

hzoo opened this issue Sep 27, 2016 · 3 comments
Labels
help wanted outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@hzoo
Copy link
Member

hzoo commented Sep 27, 2016

Ref #4576 (comment) and commited in 5ea57d5

In an exec test, you can now return a promise. We use mochajs.org for tests and returning a promise will cause it to asynchronously call done.

return forEach(genAnswers(), function(val) { output += val.value })
.then(function () {
assert.equal(output, 42);
});

return forEach(genAnswers(), function(val) { output += val.value })
.then(function () {
  assert.equal(output, 42);
});

You need to add to options.json (to fix parser error)

{
  "parserOpts": {
      "allowReturnOutsideFunction": true
   }
}

The suggestion is to allow a rejection instead of just .then

@oleksandr-kuzmenko
Copy link
Contributor

@hzoo hi, this issue is already possible to close)

@hzoo
Copy link
Member Author

hzoo commented Feb 16, 2017

When did someone add it? I definetely don't remember adding it. There's no test with a return a().catch()

@oleksandr-kuzmenko
Copy link
Contributor

@hzoo I can add this test

@hzoo hzoo removed the Has PR label Mar 19, 2017
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 2, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants