I have a react.js project and have just gotten started with testing. I installed the react-testing-library and jest to get started with it.
However, when I run
npm test
I get the following error.
/Users/Tomascdmota/Downloads/Trust-Motores-main/node_modules/react-scripts/node_modules/jest-cli/build/cli/index.js:40
execute(argv, argv.projects, result => {
^
TypeError: execute is not a function
at Object.run (/Users/Tomascdmota/Downloads/Trust-Motores-main/node_modules/react-scripts/node_modules/jest-cli/build/cli/index.js:40:3)
at Object.<anonymous> (/Users/Tomascdmota/Downloads/Trust-Motores-main/node_modules/react-scripts/scripts/test.js:104:6)
at Module._compile (node:internal/modules/cjs/loader:1091:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1120:10)
at Module.load (node:internal/modules/cjs/loader:971:32)
at Function.Module._load (node:internal/modules/cjs/loader:812:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47
My jest version is 26.6.0 I haven't added anything.
I have deleted the node_modules, package-lock.json, yarn.lock and removed jest from the dependencies/DevDependencies. After that I ran yarn install.
I still get that same error. I have googled the error and looked it up here on SO but came short-handed.
Any helps is appreciated.