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

no-async-fn-without-await errors when await is last call #147

Closed
ekmartin opened this issue Oct 11, 2016 · 3 comments · Fixed by #148
Closed

no-async-fn-without-await errors when await is last call #147

ekmartin opened this issue Oct 11, 2016 · 3 comments · Fixed by #148

Comments

@ekmartin
Copy link

test.after(async () => {
  await app.stop();
});

Is this because the test could just return the promise explicitly instead? If so maybe it would be better to split it into its own rule, it's kind of confusing at the moment.

@sindresorhus
Copy link
Member

That should not be an error. Sounds like a bug.

@jfmengels
Copy link
Contributor

jfmengels commented Oct 11, 2016

I agree, that sounds like a bug (though obviously, you could return the Promise directly).

@ekmartin I tried adding your example in my tests and was expecting tests to fail, but I could not reproduce.

Does that code excerpt (along with the require of app and ava) suffice to get that error report? If not, could you try to find a minimal viable bug to reproduce? Thanks!

@ekmartin
Copy link
Author

It does indeed @jfmengels:

import test from 'ava';

const something = () => null;
test.after(async () => {
  await something();
});

Using the newest release of xo (0.17), with esnext enabled.

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 a pull request may close this issue.

3 participants