-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Describe the bug
When using manual mocks, the mock doesn't seem to work when vitest is run on a lowercase drive (i.e. running on c:\ vs C:).
This seems to be related to #5251, but I'm opening this as a separate issue since I think it relates to a different part of the code.
Reproduction
Using an example repository I created for this example: https://github.com/dylanclaywell/lowercase-test
NOTE: Make sure to run these steps on a Windows machine in a command prompt. Command prompt recommended because depending on the version of Powershell, Powershell might normalize the directory name including the drive letter, which results in not being able to reproduce this issue.
-
Clone this repository anywhere on your local machine
-
Navigate to the directory this project was cloned on, making sure to use an absolute path that contains the lowercase
c:/drive letter.
For example:cd c:/<repo path>
-
Run
npm install -
Run
npm run test -
Note the failing test (I have the test setup to expect a specific mocked value)
-
Navigate to this same directory, making sure to use an absolute path that contains the uppercase
c:/drive letter.
For example:cd C:/<repo path>
-
Run
npm run testagain -
Note the succeeding test (the mocked value is returned in this case, so the test passes)
System Info
System:
OS: Windows 11 10.0.22621
CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
Memory: 34.51 GB / 63.20 GB
Binaries:
Node: 18.17.1 - C:\Program Files\nodejs\node.EXE
npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (123.0.2420.97)
Internet Explorer: 11.0.22621.3527Used 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.