-3

Can anyone provide a solution as to why this repo will not run the test?

https://github.com/robport/nextjs-solana

Rob P
  • 37
  • 1
  • 5

1 Answers1

1

If you need to make it work, this is a solution. Basically jest does not like to work with file in "newer" js formats (specifically, it does not like import or export statements, that is what it is complaining about in the message when you run yarn test). I will cite jest documentation to be more clear, you can find it at this link

Sometimes it happens (especially in React Native or TypeScript projects) that 3rd party modules are published as untranspiled code. Since all files inside node_modules are not transformed by default, Jest will not understand the code in these modules, resulting in syntax errors. To overcome this, you may use transformIgnorePatterns to allow transpiling such modules.

"jest --transformIgnorePatterns"

Calling the script with the parameter alone solves your issue. However, you should specify the exact regex to avoid transpiling everything. Check also this to investigate more.

cecia234
  • 46
  • 1
  • 6