-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
When there exists a test suite nested inside a test case the test suite is not enumerated, while this appears to be the correct behaviour it would be great if an error can be raised.
When there is a test case nested within a test case Vitest would throw an error: "Calling the test function inside another test function is not allowed. Please put it inside "describe" or "suite" so it can be properly collected."
Given that Vitest can detect the nested test case scenario it should also be able to detect that a test suite is nested within a test case and take appropriate action, whether that is throwing an error or permit the enumeration and running of the nested test suite(s).
Reproduction
System Info
System:
OS: Windows 11 10.0.22631
CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
Memory: 27.99 GB / 63.94 GB
Binaries:
Node: 24.11.0
Yarn: 1.22.22
npm: Using node version:
v24.11.0
11.6.1
Browsers:
Chrome: 143.0.7499.40
Edge: Spartan
Firefox: 145.0.2
Internet Explorer: 11.0.22621.3527
npmPackages:
@vitejs/plugin-react: ^4.4.1 => 4.4.1
@vitest/eslint-plugin: ^1.2.0 => 1.2.0
vite: ^6.3.5 => 6.3.5
vitest: ^4.0.15 => 4.0.15Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)