jest icon indicating copy to clipboard operation
jest copied to clipboard

jest doesn't work with virtual driver created with subst on Windows

Open wangito33 opened this issue 1 year ago • 5 comments

Version

29.7.0

Steps to reproduce

subst x: C:\Users\buildbot\actcache\act\c43893a83296c120

run jest inside X:\hostexecutor\datastore\ui\electron

Got error:

Error: Jest: Failed to parse the TypeScript config file C:\Users\buildbot\actcache\act\c43893a83296c120\hostexecutor\datastore\ui\electron\jest.config.ts 2024-04-09T07:23:29.9462295Z Error: Must use import to load ES Module: C:\Users\buildbot\actcache\act\c43893a83296c120\hostexecutor\datastore\ui\electron\jest.config.ts 2024-04-09T07:23:29.9472459Z require() of ES modules is not supported. 2024-04-09T07:23:29.9473523Z require() of C:\Users\buildbot\actcache\act\c43893a83296c120\hostexecutor\datastore\ui\electron\jest.config.ts from X:\hostexecutor\datastore\ui\electron\node_modules\jest-config\build

If subst is not used and test executed inside C:\Users\buildbot\actcache\act\c43893a83296c120\hostexecutor\datastore\ui\electron, it works fine.

Ideally X: should be used instead of C:\Users\buildbot\actcache\act\c43893a83296c120.

Expected behavior

test works even if virtual driver is used. Since this helps ccache etc.

Actual behavior

Error: Jest: Failed to parse the TypeScript config file C:\Users\buildbot\actcache\act\c43893a83296c120\hostexecutor\datastore\ui\electron\jest.config.ts 2024-04-09T07:23:29.9462295Z Error: Must use import to load ES Module: C:\Users\buildbot\actcache\act\c43893a83296c120\hostexecutor\datastore\ui\electron\jest.config.ts 2024-04-09T07:23:29.9472459Z require() of ES modules is not supported. 2024-04-09T07:23:29.9473523Z require() of C:\Users\buildbot\actcache\act\c43893a83296c120\hostexecutor\datastore\ui\electron\jest.config.ts from X:\hostexecutor\datastore\ui\electron\node_modules\jest-config\build

Additional context

No response

Environment

System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 AMD Ryzen 9 7950X 16-Core Processor
  Binaries:
    Node: 20.12.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    jest: ^29.7.0 => 29.7.0

wangito33 avatar Apr 09 '24 09:04 wangito33

See also https://github.com/jestjs/jest/issues/8063

wangito33 avatar Apr 09 '24 09:04 wangito33

I see that the code linked in https://github.com/jestjs/jest/issues/8063 still uses realpath-native which is archived at 2020. Maybe change its use to node native realpath function is enough to fix the issue but this would require node 9.3 and later.

wangito33 avatar Apr 09 '24 09:04 wangito33

Ok. sorry. it seems that realpath-native is already removed in the version that I've used.

wangito33 avatar Apr 09 '24 10:04 wangito33

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar May 09 '24 11:05 github-actions[bot]

Still relevant.

wangito33 avatar Jun 04 '24 15:06 wangito33

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Jul 04 '24 16:07 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

github-actions[bot] avatar Aug 03 '24 16:08 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

github-actions[bot] avatar Aug 03 '24 16:08 github-actions[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

github-actions[bot] avatar Sep 04 '24 00:09 github-actions[bot]