Open FantasqueX opened 2 years ago
Looks like an incompatible version of node-fetch is installed.
My local node-fetch version is 3.1.1. How to fix this problem? Maybe a patch to downgrade node-fetch?
3.1.1 should be compatible.
$ yarn why node-fetch
yarn why v1.22.17
[1/4] 🤔 Why do we have the module "node-fetch"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "node-fetch@3.1.1"
info Has been hoisted to "node-fetch"
info This module exists because it's specified in "devDependencies".
info Disk size without dependencies: "180KB"
info Disk size with unique dependencies: "180KB"
info Disk size with transitive dependencies: "180KB"
info Number of shared dependencies: 3
=> Found "cross-fetch#node-fetch@2.1.2"
info This module exists because "jest-fetch-mock#cross-fetch" depends on it.
info Disk size without dependencies: "120KB"
info Disk size with unique dependencies: "120KB"
info Disk size with transitive dependencies: "120KB"
info Number of shared dependencies: 0
=> Found "@storybook/core#node-fetch@2.6.1"
info This module exists because "@storybook#react#@storybook#core" depends on it.
=> Found "isomorphic-fetch#node-fetch@1.7.3"
info This module exists because "@storybook#components#recompose#fbjs#isomorphic-fetch" depends on it.
info Disk size without dependencies: "172KB"
info Disk size with unique dependencies: "648KB"
info Disk size with transitive dependencies: "1.09MB"
info Number of shared dependencies: 4
✨ Done in 1.15s.
According to https://github.com/node-fetch/node-fetch/issues/1391, I think we need to downgrade node-fetch due to old jest
node-fetch version 2.6.7 is testable
Device info
Describe the bug
When running test suite
yarn test
, yarn complains that all tests fail.An example log is listed below.
It seems that all tests fail because jest fails to recognize import.