consistent-data-testid
: Wrong {fileName}
value in testIdPattern
on Windows
#782
Labels
bug
Something isn't working
Have you read the Troubleshooting section?
Yes
Plugin version
v5.11.0
ESLint version
v8.35.0
Node.js version
v16.20.1
package manager and version
v8.19.4
Operating system
Windows 11
Bug description
Context
In the plugin
consistent-data-testid
we are able to use the following placeholder{fileName}
inside thetestIdPattern
so that the test ids include the file name.Issue
On Windows 11, the value of the
fileName
is wrong as it contains the full path to the file.Example value
Example of the wrong file name:
Expected value
Expected file name:
Possible cause
This might be due to the way the
fileName
is parsed by the plugin.When I test with the following on Windows, it works:
Steps to reproduce
See bug description
Error output/screenshots
No response
ESLint configuration
Rule(s) affected
testing-library/consistent-data-testid
Anything else?
No response
Do you want to submit a pull request to fix this bug?
No
The text was updated successfully, but these errors were encountered: