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

Parity in concurrent between jasmine and jest-jasmine #9163

Closed
Mark1626 opened this issue Nov 11, 2019 · 7 comments
Closed

Parity in concurrent between jasmine and jest-jasmine #9163

Mark1626 opened this issue Nov 11, 2019 · 7 comments

Comments

@Mark1626
Copy link
Contributor

🐛 Bug Report

There seems to be a parity between jest-jasmine and jest-circus on dealing with test.concurrent

For the below example

jest-jasmine throws

Jest: concurrent test "should test 2 + 1" must return a Promise

whereas jest-circus passes

The examples I've found for test.concurrent mention that the test should return a Promise
#4281 (comment)

To Reproduce

test.concurrent("should test 2 + 1", () => {
  expect(2 + 1).toEqual(3);
})

Expected behavior

Consistent behavior between jest-jasmine and jest-circus

envinfo

System:
    OS: macOS Mojave 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 10.16.0
    Yarn: 1.13.0
    npm: 6.9.0
  npmPackages:
    jest: ^24.9.0 => 24.9.0

cc \ @SimenB Noticed this while I was working on #8985

@SimenB
Copy link
Member

SimenB commented Nov 11, 2019

Does it work just making the test async? If so, we just need to do Promise.resolve on the test function and remove the warning

@Mark1626
Copy link
Contributor Author

Yes, making it async would make it pass in jest-jasmine. Looks rather straight forward to add a Promise.resolve

https://github.com/facebook/jest/blob/77c17bc1dd044a8fe32d902376d9dd97ee390d8a/packages/jest-jasmine2/src/jasmineAsyncInstall.ts#L160-L165

@Mark1626
Copy link
Contributor Author

Mark1626 commented Nov 11, 2019

I'll raise a PR for this, if this is supposed to be the expected behavior

@SimenB
Copy link
Member

SimenB commented Nov 11, 2019

Yeah, no reason not to. I think the point is that, since js is js, if your tests isn't async marking it concurrent makes no sense. Not sure what we should do about the done callback, though

@github-actions
Copy link

This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Feb 25, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions
Copy link

github-actions bot commented May 3, 2022

This issue 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 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants