From ccfae15611f0a6e2e61f5444e0cf689459c9f398 Mon Sep 17 00:00:00 2001 From: shulaoda Date: Wed, 4 Sep 2024 01:48:01 +0800 Subject: [PATCH 1/3] chore(linter/vitest): improve docs for vitest rules --- .../src/rules/vitest/no_conditional_tests.rs | 5 +++++ .../oxc_linter/src/rules/vitest/no_import_node_test.rs | 8 ++++++-- crates/oxc_linter/src/rules/vitest/prefer_each.rs | 5 +++++ .../oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs | 10 ++++++++-- .../oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs | 10 ++++++++-- ...uire_local_test_context_for_concurrent_snapshots.rs | 9 +++++++-- 6 files changed, 39 insertions(+), 8 deletions(-) diff --git a/crates/oxc_linter/src/rules/vitest/no_conditional_tests.rs b/crates/oxc_linter/src/rules/vitest/no_conditional_tests.rs index fa51c4362510c..ba31466bdc33d 100644 --- a/crates/oxc_linter/src/rules/vitest/no_conditional_tests.rs +++ b/crates/oxc_linter/src/rules/vitest/no_conditional_tests.rs @@ -23,8 +23,13 @@ pub struct NoConditionalTests; declare_oxc_lint!( /// ### What it does + /// /// The rule disallows the use of conditional statements within test cases to ensure that tests are deterministic and clearly readable. /// + /// ### Why is this bad? + /// + /// Conditional statements in test cases can make tests unpredictable and harder to understand. Tests should be consistent and straightforward to ensure reliable results and maintainability. + /// /// ### Examples /// /// Examples of **incorrect** code for this rule: diff --git a/crates/oxc_linter/src/rules/vitest/no_import_node_test.rs b/crates/oxc_linter/src/rules/vitest/no_import_node_test.rs index 87c032c5d8965..987007201f761 100644 --- a/crates/oxc_linter/src/rules/vitest/no_import_node_test.rs +++ b/crates/oxc_linter/src/rules/vitest/no_import_node_test.rs @@ -18,10 +18,14 @@ declare_oxc_lint!( /// /// This rule warns when `node:test` is imported (usually accidentally). With `--fix`, it will replace the import with `vitest`. /// + /// ### Why is this bad? + /// + /// Using `node:test` instead of `vitest` can lead to inconsistent test results and missing features. `vitest` should be used for all testing to ensure compatibility and access to its full functionality. + /// /// ### Examples /// + /// Examples of **incorrect** code for this rule: /// ```javascript - /// // invalid /// import { test } from 'node:test' /// import { expect } from 'vitest' /// @@ -30,8 +34,8 @@ declare_oxc_lint!( /// }) /// ``` /// + /// Examples of **correct** code for this rule: /// ```javascript - /// // valid /// import { test, expect } from 'vitest' /// /// test('foo', () => { diff --git a/crates/oxc_linter/src/rules/vitest/prefer_each.rs b/crates/oxc_linter/src/rules/vitest/prefer_each.rs index 014884d43d4f1..a271ac2faedef 100644 --- a/crates/oxc_linter/src/rules/vitest/prefer_each.rs +++ b/crates/oxc_linter/src/rules/vitest/prefer_each.rs @@ -38,8 +38,13 @@ pub struct PreferEach; declare_oxc_lint!( /// ### What it does + /// /// This rule enforces using `each` rather than manual loops. /// + /// ### Why is this bad? + /// + /// Manual loops for tests can be less readable and more error-prone. Using `each` provides a clearer and more concise way to run parameterized tests, improving readability and maintainability. + /// /// ### Examples /// /// Examples of **incorrect** code for this rule: diff --git a/crates/oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs b/crates/oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs index edd060a8da797..208bade16d3b7 100644 --- a/crates/oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs +++ b/crates/oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs @@ -14,14 +14,20 @@ declare_oxc_lint!( /// /// This rule warns when `toBe(false)` is used with `expect` or `expectTypeOf`. With `--fix`, it will be replaced with `toBeFalsy()`. /// + /// ### Why is this bad? + /// + /// Using `toBe(false)` is less expressive and may not account for other falsy values like `0`, `null`, or `undefined`. `toBeFalsy()` provides a more comprehensive check for any falsy value, improving the robustness of the tests. + /// /// ### Examples /// + /// Examples of **incorrect** code for this rule: /// ```javascript - /// // bad /// expect(foo).toBe(false) /// expectTypeOf(foo).toBe(false) + /// ``` /// - /// // good + /// Examples of **correct** code for this rule: + /// ```javascript /// expect(foo).toBeFalsy() /// expectTypeOf(foo).toBeFalsy() /// ``` diff --git a/crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs b/crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs index 9997e8a5d41c9..8f2e236f8989e 100644 --- a/crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs +++ b/crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs @@ -14,14 +14,20 @@ declare_oxc_lint!( /// /// This rule warns when `toBe(true)` is used with `expect` or `expectTypeOf`. With `--fix`, it will be replaced with `toBeTruthy()`. /// + /// ### Why is this bad? + /// + /// Using `toBe(true)` is less flexible and may not account for other truthy values like non-empty strings or objects. `toBeTruthy()` checks for any truthy value, which makes the tests more comprehensive and robust. + /// /// ### Examples /// + /// Examples of **incorrect** code for this rule: /// ```javascript - /// // bad /// expect(foo).toBe(true) /// expectTypeOf(foo).toBe(true) + /// ``` /// - /// // good + /// Examples of **correct** code for this rule: + /// ```javascript /// expect(foo).toBeTruthy() /// expectTypeOf(foo).toBeTruthy() /// ``` diff --git a/crates/oxc_linter/src/rules/vitest/require_local_test_context_for_concurrent_snapshots.rs b/crates/oxc_linter/src/rules/vitest/require_local_test_context_for_concurrent_snapshots.rs index 067f2ad7dd62b..329fa2f1d1c36 100644 --- a/crates/oxc_linter/src/rules/vitest/require_local_test_context_for_concurrent_snapshots.rs +++ b/crates/oxc_linter/src/rules/vitest/require_local_test_context_for_concurrent_snapshots.rs @@ -50,12 +50,17 @@ pub struct RequireLocalTestContextForConcurrentSnapshots; declare_oxc_lint!( /// ### What it does + /// /// The rule is intended to ensure that concurrent snapshot tests are executed within a properly configured local test context. /// + /// ### Why is this bad? + /// + /// Running snapshot tests concurrently without a proper context can lead to unreliable or inconsistent snapshots. Ensuring that concurrent tests are correctly configured with the appropriate context helps maintain accurate and stable snapshots, avoiding potential conflicts or failures. + /// /// ### Examples /// /// Examples of **incorrect** code for this rule: - /// ```js + /// ```javascript /// test.concurrent('myLogic', () => { /// expect(true).toMatchSnapshot(); /// }) @@ -69,7 +74,7 @@ declare_oxc_lint!( /// ``` /// /// Examples of **correct** code for this rule: - /// ```js + /// ```javascript /// test.concurrent('myLogic', ({ expect }) => { /// expect(true).toMatchSnapshot(); /// }) From e4ccd4f3d4c2d431ae7a306de013627debd92e5c Mon Sep 17 00:00:00 2001 From: shulaoda Date: Wed, 4 Sep 2024 12:06:53 +0800 Subject: [PATCH 2/3] chore: wrap docs --- .../oxc_linter/src/rules/vitest/no_conditional_tests.rs | 7 +++++-- crates/oxc_linter/src/rules/vitest/no_import_node_test.rs | 7 +++++-- crates/oxc_linter/src/rules/vitest/prefer_each.rs | 4 +++- crates/oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs | 7 +++++-- crates/oxc_linter/src/rules/vitest/prefer_to_be_object.rs | 5 ++++- crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs | 7 +++++-- ...require_local_test_context_for_concurrent_snapshots.rs | 8 ++++++-- 7 files changed, 33 insertions(+), 12 deletions(-) diff --git a/crates/oxc_linter/src/rules/vitest/no_conditional_tests.rs b/crates/oxc_linter/src/rules/vitest/no_conditional_tests.rs index ba31466bdc33d..b9b37198da4a7 100644 --- a/crates/oxc_linter/src/rules/vitest/no_conditional_tests.rs +++ b/crates/oxc_linter/src/rules/vitest/no_conditional_tests.rs @@ -24,11 +24,14 @@ pub struct NoConditionalTests; declare_oxc_lint!( /// ### What it does /// - /// The rule disallows the use of conditional statements within test cases to ensure that tests are deterministic and clearly readable. + /// The rule disallows the use of conditional statements within test cases to + /// ensure that tests are deterministic and clearly readable. /// /// ### Why is this bad? /// - /// Conditional statements in test cases can make tests unpredictable and harder to understand. Tests should be consistent and straightforward to ensure reliable results and maintainability. + /// Conditional statements in test cases can make tests unpredictable and + /// harder to understand. Tests should be consistent and straightforward to + /// ensure reliable results and maintainability. /// /// ### Examples /// diff --git a/crates/oxc_linter/src/rules/vitest/no_import_node_test.rs b/crates/oxc_linter/src/rules/vitest/no_import_node_test.rs index 987007201f761..a15a2a87b036f 100644 --- a/crates/oxc_linter/src/rules/vitest/no_import_node_test.rs +++ b/crates/oxc_linter/src/rules/vitest/no_import_node_test.rs @@ -16,11 +16,14 @@ pub struct NoImportNodeTest; declare_oxc_lint!( /// ### What it does /// - /// This rule warns when `node:test` is imported (usually accidentally). With `--fix`, it will replace the import with `vitest`. + /// This rule warns when `node:test` is imported (usually accidentally). + /// With `--fix`, it will replace the import with `vitest`. /// /// ### Why is this bad? /// - /// Using `node:test` instead of `vitest` can lead to inconsistent test results and missing features. `vitest` should be used for all testing to ensure compatibility and access to its full functionality. + /// Using `node:test` instead of `vitest` can lead to inconsistent test results + /// and missing features. `vitest` should be used for all testing to ensure + /// compatibility and access to its full functionality. /// /// ### Examples /// diff --git a/crates/oxc_linter/src/rules/vitest/prefer_each.rs b/crates/oxc_linter/src/rules/vitest/prefer_each.rs index a271ac2faedef..98b2ea33480fc 100644 --- a/crates/oxc_linter/src/rules/vitest/prefer_each.rs +++ b/crates/oxc_linter/src/rules/vitest/prefer_each.rs @@ -43,7 +43,9 @@ declare_oxc_lint!( /// /// ### Why is this bad? /// - /// Manual loops for tests can be less readable and more error-prone. Using `each` provides a clearer and more concise way to run parameterized tests, improving readability and maintainability. + /// Manual loops for tests can be less readable and more error-prone. Using + /// `each` provides a clearer and more concise way to run parameterized tests, + /// improving readability and maintainability. /// /// ### Examples /// diff --git a/crates/oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs b/crates/oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs index 208bade16d3b7..535e3421014db 100644 --- a/crates/oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs +++ b/crates/oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs @@ -12,11 +12,14 @@ pub struct PreferToBeFalsy; declare_oxc_lint!( /// ### What it does /// - /// This rule warns when `toBe(false)` is used with `expect` or `expectTypeOf`. With `--fix`, it will be replaced with `toBeFalsy()`. + /// This rule warns when `toBe(false)` is used with `expect` or `expectTypeOf`. + /// With `--fix`, it will be replaced with `toBeFalsy()`. /// /// ### Why is this bad? /// - /// Using `toBe(false)` is less expressive and may not account for other falsy values like `0`, `null`, or `undefined`. `toBeFalsy()` provides a more comprehensive check for any falsy value, improving the robustness of the tests. + /// Using `toBe(false)` is less expressive and may not account for other falsy + /// values like `0`, `null`, or `undefined`. `toBeFalsy()` provides a more + /// comprehensive check for any falsy value, improving the robustness of the tests. /// /// ### Examples /// diff --git a/crates/oxc_linter/src/rules/vitest/prefer_to_be_object.rs b/crates/oxc_linter/src/rules/vitest/prefer_to_be_object.rs index 7550ce70a70ca..f0f9c012b54d6 100644 --- a/crates/oxc_linter/src/rules/vitest/prefer_to_be_object.rs +++ b/crates/oxc_linter/src/rules/vitest/prefer_to_be_object.rs @@ -42,7 +42,10 @@ declare_oxc_lint!( /// /// ### Why is this bad? /// - /// Using other methods such as `toBeInstanceOf(Object)` or `instanceof Object` can be less clear and potentially misleading. Enforcing the use of `toBeObject()` provides more explicit and readable code, making your intentions clear and improving the overall maintainability and readability of your tests. + /// Using other methods such as `toBeInstanceOf(Object)` or `instanceof Object` can + /// be less clear and potentially misleading. Enforcing the use of `toBeObject()` + /// provides more explicit and readable code, making your intentions clear and + /// improving the overall maintainability and readability of your tests. /// /// ### Examples /// diff --git a/crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs b/crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs index 8f2e236f8989e..ea29c8f65fbec 100644 --- a/crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs +++ b/crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs @@ -12,11 +12,14 @@ pub struct PreferToBeTruthy; declare_oxc_lint!( /// ### What it does /// - /// This rule warns when `toBe(true)` is used with `expect` or `expectTypeOf`. With `--fix`, it will be replaced with `toBeTruthy()`. + /// This rule warns when `toBe(true)` is used with `expect` or `expectTypeOf`. + /// With `--fix`, it will be replaced with `toBeTruthy()`. /// /// ### Why is this bad? /// - /// Using `toBe(true)` is less flexible and may not account for other truthy values like non-empty strings or objects. `toBeTruthy()` checks for any truthy value, which makes the tests more comprehensive and robust. + /// Using `toBe(true)` is less flexible and may not account for other truthy + /// values like non-empty strings or objects. `toBeTruthy()` checks for any + /// truthy value, which makes the tests more comprehensive and robust. /// /// ### Examples /// diff --git a/crates/oxc_linter/src/rules/vitest/require_local_test_context_for_concurrent_snapshots.rs b/crates/oxc_linter/src/rules/vitest/require_local_test_context_for_concurrent_snapshots.rs index 329fa2f1d1c36..a744d804d2821 100644 --- a/crates/oxc_linter/src/rules/vitest/require_local_test_context_for_concurrent_snapshots.rs +++ b/crates/oxc_linter/src/rules/vitest/require_local_test_context_for_concurrent_snapshots.rs @@ -51,11 +51,15 @@ pub struct RequireLocalTestContextForConcurrentSnapshots; declare_oxc_lint!( /// ### What it does /// - /// The rule is intended to ensure that concurrent snapshot tests are executed within a properly configured local test context. + /// The rule is intended to ensure that concurrent snapshot tests are executed + /// within a properly configured local test context. /// /// ### Why is this bad? /// - /// Running snapshot tests concurrently without a proper context can lead to unreliable or inconsistent snapshots. Ensuring that concurrent tests are correctly configured with the appropriate context helps maintain accurate and stable snapshots, avoiding potential conflicts or failures. + /// Running snapshot tests concurrently without a proper context can lead to + /// unreliable or inconsistent snapshots. Ensuring that concurrent tests are + /// correctly configured with the appropriate context helps maintain accurate + /// and stable snapshots, avoiding potential conflicts or failures. /// /// ### Examples /// From b283baccc9c12510b518739a63dec42b7b8d0ab4 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 04:07:35 +0000 Subject: [PATCH 3/3] [autofix.ci] apply automated fixes --- .../oxc_linter/src/rules/vitest/no_conditional_tests.rs | 6 +++--- crates/oxc_linter/src/rules/vitest/no_import_node_test.rs | 6 +++--- crates/oxc_linter/src/rules/vitest/prefer_each.rs | 4 ++-- crates/oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs | 6 +++--- crates/oxc_linter/src/rules/vitest/prefer_to_be_object.rs | 6 +++--- crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs | 6 +++--- ...require_local_test_context_for_concurrent_snapshots.rs | 8 ++++---- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/crates/oxc_linter/src/rules/vitest/no_conditional_tests.rs b/crates/oxc_linter/src/rules/vitest/no_conditional_tests.rs index b9b37198da4a7..17be91c8848be 100644 --- a/crates/oxc_linter/src/rules/vitest/no_conditional_tests.rs +++ b/crates/oxc_linter/src/rules/vitest/no_conditional_tests.rs @@ -24,13 +24,13 @@ pub struct NoConditionalTests; declare_oxc_lint!( /// ### What it does /// - /// The rule disallows the use of conditional statements within test cases to + /// The rule disallows the use of conditional statements within test cases to /// ensure that tests are deterministic and clearly readable. /// /// ### Why is this bad? /// - /// Conditional statements in test cases can make tests unpredictable and - /// harder to understand. Tests should be consistent and straightforward to + /// Conditional statements in test cases can make tests unpredictable and + /// harder to understand. Tests should be consistent and straightforward to /// ensure reliable results and maintainability. /// /// ### Examples diff --git a/crates/oxc_linter/src/rules/vitest/no_import_node_test.rs b/crates/oxc_linter/src/rules/vitest/no_import_node_test.rs index a15a2a87b036f..c9a9a8ae45ae4 100644 --- a/crates/oxc_linter/src/rules/vitest/no_import_node_test.rs +++ b/crates/oxc_linter/src/rules/vitest/no_import_node_test.rs @@ -16,13 +16,13 @@ pub struct NoImportNodeTest; declare_oxc_lint!( /// ### What it does /// - /// This rule warns when `node:test` is imported (usually accidentally). + /// This rule warns when `node:test` is imported (usually accidentally). /// With `--fix`, it will replace the import with `vitest`. /// /// ### Why is this bad? /// - /// Using `node:test` instead of `vitest` can lead to inconsistent test results - /// and missing features. `vitest` should be used for all testing to ensure + /// Using `node:test` instead of `vitest` can lead to inconsistent test results + /// and missing features. `vitest` should be used for all testing to ensure /// compatibility and access to its full functionality. /// /// ### Examples diff --git a/crates/oxc_linter/src/rules/vitest/prefer_each.rs b/crates/oxc_linter/src/rules/vitest/prefer_each.rs index 98b2ea33480fc..290fbce9b46fa 100644 --- a/crates/oxc_linter/src/rules/vitest/prefer_each.rs +++ b/crates/oxc_linter/src/rules/vitest/prefer_each.rs @@ -43,8 +43,8 @@ declare_oxc_lint!( /// /// ### Why is this bad? /// - /// Manual loops for tests can be less readable and more error-prone. Using - /// `each` provides a clearer and more concise way to run parameterized tests, + /// Manual loops for tests can be less readable and more error-prone. Using + /// `each` provides a clearer and more concise way to run parameterized tests, /// improving readability and maintainability. /// /// ### Examples diff --git a/crates/oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs b/crates/oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs index 535e3421014db..cabcf794a9533 100644 --- a/crates/oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs +++ b/crates/oxc_linter/src/rules/vitest/prefer_to_be_falsy.rs @@ -12,13 +12,13 @@ pub struct PreferToBeFalsy; declare_oxc_lint!( /// ### What it does /// - /// This rule warns when `toBe(false)` is used with `expect` or `expectTypeOf`. + /// This rule warns when `toBe(false)` is used with `expect` or `expectTypeOf`. /// With `--fix`, it will be replaced with `toBeFalsy()`. /// /// ### Why is this bad? /// - /// Using `toBe(false)` is less expressive and may not account for other falsy - /// values like `0`, `null`, or `undefined`. `toBeFalsy()` provides a more + /// Using `toBe(false)` is less expressive and may not account for other falsy + /// values like `0`, `null`, or `undefined`. `toBeFalsy()` provides a more /// comprehensive check for any falsy value, improving the robustness of the tests. /// /// ### Examples diff --git a/crates/oxc_linter/src/rules/vitest/prefer_to_be_object.rs b/crates/oxc_linter/src/rules/vitest/prefer_to_be_object.rs index f0f9c012b54d6..5d0b6acad00bc 100644 --- a/crates/oxc_linter/src/rules/vitest/prefer_to_be_object.rs +++ b/crates/oxc_linter/src/rules/vitest/prefer_to_be_object.rs @@ -42,9 +42,9 @@ declare_oxc_lint!( /// /// ### Why is this bad? /// - /// Using other methods such as `toBeInstanceOf(Object)` or `instanceof Object` can - /// be less clear and potentially misleading. Enforcing the use of `toBeObject()` - /// provides more explicit and readable code, making your intentions clear and + /// Using other methods such as `toBeInstanceOf(Object)` or `instanceof Object` can + /// be less clear and potentially misleading. Enforcing the use of `toBeObject()` + /// provides more explicit and readable code, making your intentions clear and /// improving the overall maintainability and readability of your tests. /// /// ### Examples diff --git a/crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs b/crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs index ea29c8f65fbec..836f8160817e2 100644 --- a/crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs +++ b/crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs @@ -12,13 +12,13 @@ pub struct PreferToBeTruthy; declare_oxc_lint!( /// ### What it does /// - /// This rule warns when `toBe(true)` is used with `expect` or `expectTypeOf`. + /// This rule warns when `toBe(true)` is used with `expect` or `expectTypeOf`. /// With `--fix`, it will be replaced with `toBeTruthy()`. /// /// ### Why is this bad? /// - /// Using `toBe(true)` is less flexible and may not account for other truthy - /// values like non-empty strings or objects. `toBeTruthy()` checks for any + /// Using `toBe(true)` is less flexible and may not account for other truthy + /// values like non-empty strings or objects. `toBeTruthy()` checks for any /// truthy value, which makes the tests more comprehensive and robust. /// /// ### Examples diff --git a/crates/oxc_linter/src/rules/vitest/require_local_test_context_for_concurrent_snapshots.rs b/crates/oxc_linter/src/rules/vitest/require_local_test_context_for_concurrent_snapshots.rs index a744d804d2821..4247b8d546a76 100644 --- a/crates/oxc_linter/src/rules/vitest/require_local_test_context_for_concurrent_snapshots.rs +++ b/crates/oxc_linter/src/rules/vitest/require_local_test_context_for_concurrent_snapshots.rs @@ -51,14 +51,14 @@ pub struct RequireLocalTestContextForConcurrentSnapshots; declare_oxc_lint!( /// ### What it does /// - /// The rule is intended to ensure that concurrent snapshot tests are executed + /// The rule is intended to ensure that concurrent snapshot tests are executed /// within a properly configured local test context. /// /// ### Why is this bad? /// - /// Running snapshot tests concurrently without a proper context can lead to - /// unreliable or inconsistent snapshots. Ensuring that concurrent tests are - /// correctly configured with the appropriate context helps maintain accurate + /// Running snapshot tests concurrently without a proper context can lead to + /// unreliable or inconsistent snapshots. Ensuring that concurrent tests are + /// correctly configured with the appropriate context helps maintain accurate /// and stable snapshots, avoiding potential conflicts or failures. /// /// ### Examples