Y-Foundry-Dao / yfd-dapp-core

Governance dApp
GNU Affero General Public License v3.0
2 stars 1 forks source link

Fix Jest Testing #27

Open Tgrede opened 2 years ago

Tgrede commented 2 years ago

After upgrading to react 18 Jest no longer worked.

image

In our config-overrides.js file we are resolving crypto to crypto-browserify

image

which is explained here as something we do to resolve modules that are native to node but not browsers (essentially poly filling those modules for webpack 5 to be able to use them on the front end)

I tried solutions from this post which actually fixed the crypto not found error.

however now I get an error that useRecoilValue can't be used outside of RecoilRoot despite the application working just fine and having a RecoilRoot in our index.tsx file.

image

Fixing this issue is necessary to get our testing framework up and running again