Skip to content

Tests passing on Linux but failing on Windows (yeah weird) #379

@iShibi

Description

@iShibi

Describe the bug

I have a project (esm) that uses undici (cjs). Everything works as expected during runtime but for some reason, the tests are failing. By looking at the error, it seems that vitest thinks module.exports.Something is undefined when undici does module.exports.Something = Something. What's weird is that this only happens on Windows, on Linux the same tests get passed without any issue.

I have created a repro for the issue that I'm facing. Try to run the tests on both Linux and Windows. It would fail on Windows.

Reproduction

https://github.com/iShibi/issue-repro

System Info

System:
  OS: Windows 10 10.0.19043
  CPU: (12) x64 AMD Ryzen 5 4600H with Radeon Graphics
  Memory: 1.67 GB / 7.36 GB
Binaries:
  Node: 16.13.1 - ~\AppData\Local\Volta\tools\image\node\16.13.1\node.EXE
  Yarn: 1.22.11 - ~\AppData\Local\Volta\tools\image\yarn\1.22.11\bin\yarn.CMD
  npm: 8.1.2 - ~\AppData\Local\Volta\tools\image\node\16.13.1\npm.CMD
Browsers:
  Edge: Spartan (44.19041.1266.0), Chromium (96.0.1054.62)
  Internet Explorer: 11.0.19041.1202
npmPackages:
  vitest: ^0.0.124 => 0.0.124

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions