-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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.concurrent and snapshot support. #2180
Comments
cc @DmitriiAbramov ping! |
here's what we have right now:
In concurrent mode right now we have two problems:
both can be solved by using named snapshots, although we'll lose the test name in the snapshot name (it'll be regarding throwing in concurrent mode. not sure about that. If we run tests in concurrent mode, during any test execution you can expect We can require named snapshot fro all |
Hey gang 👋 I just discovered this while adding a test to Yarn which is using Jest v20.0.4 I think it's the same issue as this; I have several Jest succeeds and reports
However the written snapshot is for the wrong test name. I understand there are some concurrency issues, but as a stopgap solution, would it be possible to error with some meaningful message if you even attempt to use a snapshot in a concurrent test? edit ; just noticed the response that said that this might not be possible to detect... oops :) |
I think it's fair to require named snapshots when using |
Any updates on this? I recently ran into this issue when trying to speed up some slow integration tests. |
I don't use |
async tests should work fine... are you forgetting an |
In the above referenced PR we found that We found that each run would result in snapshot failures. As if the pairing between saved snaps and test runs was getting confused. We were naming our snapshots ( Should our team wait for support here or ditch Is jest test file concurrency slower than |
@jasonkuhrt File concurrency has more overhead as we need to spawn processes and inject the whole test env multiple times. But if the tests themselves are slower than that overhead (which is usually the case with integration tests) then you should have better times using file concurrency |
Actually, that would be nice to support string passed to toMatchSnapshot() (once it's passed) as the only source of truth for snapshot name. Or there may be object with {name:"snapshot name"} passed. |
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 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
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. |
Once we support named snapshots, a snapshot doesn't need to depend on test case state any more. That way
test.concurrent
can use snapshots as well.cc @DmitriiAbramov Can we make it so we throw when using toMatchSnapshot without arguments in the concurrent mode? I'm not sure where I'd add this right now.
The text was updated successfully, but these errors were encountered: