-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
docs: update snapshot section to provide details on how to use with concurrent test #2733
Conversation
docs/guide/features.md
Outdated
@@ -44,16 +44,16 @@ Learn more about [Test Filtering](./filtering.md). | |||
|
|||
## Running tests concurrently | |||
|
|||
Use `.concurrent` in consecutive tests to run them in parallel. | |||
Use `.concurrent` in consecutive tests to run them in parallel. Also, be sure to use `expect` from the [Test Context](/guide/test-context.md) to ensure the right test is being detected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add ::warning
section and mention snapshot testing there and expect.assertions
. Otherwise, it doesn't matter what expect you use there.
docs/api/index.md
Outdated
@@ -149,13 +149,15 @@ You cannot use this syntax, when using Vitest as [type checker](/guide/testing-t | |||
test.todo.concurrent(/* ... */) // or test.concurrent.todo(/* ... */) | |||
``` | |||
|
|||
When using Snapshots with async concurrent tests, due to the limitation of JavaScript, you need to use the `expect` from the [Test Context](/guide/test-context.md) to ensure the right test is being detected. | |||
When using Snapshots with async concurrent tests, you need to use `expect` from the [Test Context](/guide/test-context.md) and call `expect.assertions` to ensure the test will detect any failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I did not mean that. You don't need to call expect.assertions
in this case. You need to use local expect, if you are calling assertions
in a concurrent
test. This is also true for your other edits. We just need to mention that this API depends on the local expect in this case.
@dammy001 can you review this PR, please? |
remove extra spaces Co-authored-by: Anjorin Damilare <damilareanjorin1@gmail.com>
docs: update Snapshot section to provide details on how to use with concurrent test
close #2729