jestjs/jest

[Bug]: Manual mocks file name for node protocol imports (node:)

Open

#14,040 建立於 2023年3月30日

在 GitHub 查看
 (12 留言) (0 反應) (0 負責人)TypeScript (45,361 star) (6,653 fork)batch import
:bug: BugHelp WantedPinned

描述

Version

^29.5.0

Steps to reproduce

I have added minimal code setup to following codesandbox

https://codesandbox.io/p/sandbox/jest-issue-node-protocol-b6ivxb

Expected behavior

To work with node: protocol inputs in manaul mocks without node: in the file name.

Actual behavior

I can get this working on MacOS renaming the file to node:os.ts But does failed checkout in Windows as colon is not permited to use in filename. Also Codesandbox doesn't allows to have colons in the file.

Additional context

No response

Environment

System:
    OS: macOS 12.6.3
    CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  Binaries:
    Node: 18.14.2 - /usr/local/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 9.5.0 - /usr/local/bin/npm

貢獻者指南