···9999100100Vitest usually uses cache to sort tests, so long-running tests start earlier, which makes tests run faster. If your files and tests run in random order, you will lose this performance improvement, but it may be useful to track tests that accidentally depend on another test run previously.
101101102102-### sequence.shuffle.files {#sequence-shuffle-files}
102102+### sequence.shuffle.files <CRoot /> {#sequence-shuffle-files}
103103104104- **Type:** `boolean`
105105- **Default:** `false`
106106- **CLI:** `--sequence.shuffle.files`, `--sequence.shuffle.files=false`
107107108108Whether to randomize files, be aware that long running tests will not start earlier if you enable this option.
109109+110110+Because file ordering is shared across [projects](/guide/projects), this option is resolved from the root config only. A project can still randomize its own tests with [`sequence.shuffle.tests`](#sequence-shuffle-tests).
109111110112### sequence.shuffle.tests {#sequence-shuffle-tests}
111113
+1-4
packages/vitest/src/node/config/resolveConfig.ts
···790790 }
791791 resolved.sequence.groupOrder ??= 0
792792 resolved.sequence.hooks ??= 'stack'
793793- // Set seed if either files or tests are shuffled
794794- if (resolved.sequence.sequencer === RandomSequencer || resolved.sequence.shuffle) {
795795- resolved.sequence.seed ??= Date.now()
796796- }
793793+ resolved.sequence.seed ??= Date.now()
797794798795 resolved.typecheck = {
799796 ...configDefaults.typecheck,