jestjs/jest

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

Open

#14.040 aperta il 30 mar 2023

Vedi su GitHub
 (12 commenti) (0 reazioni) (0 assegnatari)TypeScript (6653 fork)batch import
:bug: BugHelp WantedPinned

Metriche repository

Star
 (45.361 star)
Metriche merge PR
 (Merge medio 11g 22h) (11 PR mergiate in 30 g)

Descrizione

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

Guida contributor