-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Labels
p2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)
Description
Describe the bug
The getTaskFullName() function injects a leading space when it detects a suite. However, a suite itself includes a suite property with an empty name, and therefore it runs twice on a suite. The end result is that every test inside a suite ends up with a full task name that has a leading single-space indentation, which breaks regular expression patterns like this:
--testNamePattern '^my-suite-prefix:'
I did finally get it working, by using this to account for the leading space.
--testNamePattern '^\s*my-suite-prefix:'
Reproduction
--testNamePattern '^my-suite-prefix:'
Will not match a suite like this:
describe('my-suite-prefix:', () => { ... });
System Info
Vitest 0.34.3Used 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
p2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)
Type
Projects
Status
P2 - 2