When running tests that encounter an error in a required file, the generated trace does not point to the correct file.
ReferenceError: boop is not defined
❯ test/main.test.js:5:12
> src/main.js:2:9
1| export function testFunc(x) {
2| return boop(x);
| ^
3| }
ReferenceError: boop is not defined
❯ Module.testFunc ../../../../../src/main.js:2:3
❯ test/main.test.js:5:12
3| describe('Main test', () => {
4| it('should blow up here', () => {
5| expect(testFunc(5)).toBe(10);
| ^
6| });
7| });
System:
OS: macOS 13.2.1
CPU: (8) x64 Apple M1 Pro
Memory: 19.44 MB / 32.00 GB
Shell: 3.5.1 - /usr/local/bin/fish
Binaries:
Node: 17.3.0 - /usr/local/bin/node
Yarn: 3.3.1 - /usr/local/bin/yarn
npm: 8.16.0 - /usr/local/bin/npm
Browsers:
Chrome: 110.0.5481.177
Firefox: 109.0
Safari: 16.3
npmPackages:
vite: latest => 4.1.4
vitest: latest => 0.29.2
Describe the bug
When running tests that encounter an error in a required file, the generated trace does not point to the correct file.
Expected:
Actual:
Reproduction
yarn installyarn testSystem Info
System: OS: macOS 13.2.1 CPU: (8) x64 Apple M1 Pro Memory: 19.44 MB / 32.00 GB Shell: 3.5.1 - /usr/local/bin/fish Binaries: Node: 17.3.0 - /usr/local/bin/node Yarn: 3.3.1 - /usr/local/bin/yarn npm: 8.16.0 - /usr/local/bin/npm Browsers: Chrome: 110.0.5481.177 Firefox: 109.0 Safari: 16.3 npmPackages: vite: latest => 4.1.4 vitest: latest => 0.29.2Used Package Manager
yarn
Validations