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

Add async function support to beforeEach and afterEach #1546

Merged
merged 2 commits into from
Sep 1, 2016

Conversation

ide
Copy link
Contributor

@ide ide commented Aug 31, 2016

You now can write:

beforeEach(async () => {
  await somethingAsync();
});

Fix #1256

@ide
Copy link
Contributor Author

ide commented Aug 31, 2016

Waiting for unit tests to run on Travis since everything fails locally.

@ghost ghost added the CLA Signed ✔️ label Aug 31, 2016
@cpojer
Copy link
Member

cpojer commented Aug 31, 2016

This is great! What about beforeAll/afterAll?

What is wrong locally? npm install and npm test should work.

@ide
Copy link
Contributor Author

ide commented Aug 31, 2016

What about beforeAll/afterAll?

I don't use them :P

What is wrong locally?

70 tests fail like

 FAIL  packages/jest-runtime/src/__tests__/Runtime-requireModuleOrMock-transitive-deps-test.js
  ● Test suite failed to run

    TypeError: Path must be a string. Received undefined

      at assertPath (path.js:7:11)
      at Object.dirname (path.js:1326:5)
      at Array.map (native)

Master fails too so I figured I'd just use Travis.

@cpojer
Copy link
Member

cpojer commented Sep 1, 2016

Master is passing for me and on travis. Seems like an issue with your node version?

You now can write:
```
beforeEach(async () => {
  await somethingAsync();
});
```
@codecov-io
Copy link

codecov-io commented Sep 1, 2016

Current coverage is 90.27% (diff: 100%)

Merging #1546 into master will not change coverage

@@             master      #1546   diff @@
==========================================
  Files            28         28          
  Lines          1121       1121          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits           1012       1012          
  Misses          109        109          
  Partials          0          0          

Powered by Codecov. Last update 6fa710c...d3609c7

@cpojer cpojer merged commit 0504590 into jestjs:master Sep 1, 2016
@cpojer
Copy link
Member

cpojer commented Sep 1, 2016

thank you!

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Asynchronous beforeEach / beforeAll?
3 participants