Version
29.7.0
Steps to reproduce
- Start your favorite Windows machine, this bug is only reproducible there :)
- Clone https://github.com/Filipoliko/jest-preset-windows
- Run
npm ci
- Run
npm test
- You should see the error
Expected behavior
No error, Jest should recognise that package.json file of my-jest-preset defines exports for ./jest-preset.
Actual behavior
Jest fails to start the test run due to missing jest-preset.js file, but only on Windows machines.
Jest v29.7.0 error message:
> github-jest-preset-windows@1.0.0 test
> jest
● Validation Error:
Preset my-jest-preset not found.
Configuration Documentation:
https://jestjs.io/docs/configuration
Error: Process completed with exit code 1.
Jest v30.0.0-alpha.7 error message:
> github-jest-preset-windows@1.0.0 test
> jest
● Validation Error:
Preset my-jest-preset not found relative to rootDir D:\a\jest-preset-windows\jest-preset-windows.
Configuration Documentation:
https://jestjs.io/docs/configuration
Error: Process completed with exit code 1.
Additional context
See pipeline results https://github.com/Filipoliko/jest-preset-windows/actions/runs/13372503574 (v29), https://github.com/Filipoliko/jest-preset-windows/actions/runs/13372781509 (v30) - it shows that the same jest configuration works for Linux and MacOS, but fails for Windows.
The path to jest-preset.js file is defined via exports definition in package.json - see https://github.com/Filipoliko/jest-preset-windows/blob/main/packages/my-jest-preset/package.json#L6
Environment
System:
OS: Windows 10 10.0.20348
CPU: (4) x64 AMD EPYC 7763 64-Core Processor
Binaries:
Node: 22.13.1 - C:\hostedtoolcache\windows\node\22.13.1\x64\node.EXE
Yarn: 1.22.22 - C:\npm\prefix\yarn.CMD
npm: 10.9.2 - C:\hostedtoolcache\windows\node\22.13.1\x64\npm.CMD
npmPackages:
jest: 30.0.0-alpha.7 => 30.0.0-alpha.7
Version
29.7.0
Steps to reproduce
npm cinpm testExpected behavior
No error, Jest should recognise that
package.jsonfile ofmy-jest-presetdefinesexportsfor./jest-preset.Actual behavior
Jest fails to start the test run due to missing
jest-preset.jsfile, but only on Windows machines.Jest v29.7.0 error message:
Jest v30.0.0-alpha.7 error message:
Additional context
See pipeline results https://github.com/Filipoliko/jest-preset-windows/actions/runs/13372503574 (v29), https://github.com/Filipoliko/jest-preset-windows/actions/runs/13372781509 (v30) - it shows that the same jest configuration works for Linux and MacOS, but fails for Windows.
The path to
jest-preset.jsfile is defined viaexportsdefinition inpackage.json- see https://github.com/Filipoliko/jest-preset-windows/blob/main/packages/my-jest-preset/package.json#L6Environment
System: OS: Windows 10 10.0.20348 CPU: (4) x64 AMD EPYC 7763 64-Core Processor Binaries: Node: 22.13.1 - C:\hostedtoolcache\windows\node\22.13.1\x64\node.EXE Yarn: 1.22.22 - C:\npm\prefix\yarn.CMD npm: 10.9.2 - C:\hostedtoolcache\windows\node\22.13.1\x64\npm.CMD npmPackages: jest: 30.0.0-alpha.7 => 30.0.0-alpha.7