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
Used Package Manager
npm
Validations
Describe the bug
The
getTaskFullName()function injects a leading space when it detects a suite. However, a suite itself includes asuiteproperty 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:I did finally get it working, by using this to account for the leading space.
Reproduction
Will not match a suite like this:
System Info
Used Package Manager
npm
Validations