0

I'm new to react native testing and recently I got this error. I'm still unable to find a correct solution to fix this. Could you please someone can help on this?

Thanks in advance.

Configuration error:

    Could not locate module ./fonts/galio.ttf mapped as:

 Please check your configuration for these entries:
     {
      "moduleNameMapper": {
        "/\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$/": "/Users/iswanjumat/Documents/works/jet_stream_africa/jetpaynow_mobile_app/__mocks__/fileMock.js"
      },
      "resolver": undefined
    }
TIJ
  • 2,771
  • 3
  • 19
  • 32

1 Answers1

2

I modified my jest configuration to add this:

"moduleNameMapper": {
 +     "galio": "identity-obj-proxy"
}

And installed the identity-obj-proxy package npm i identity-obj-proxy and it solved the font problem. It seems that the problem was that the font was not recognized, because it doesn't know the extension.

Here's where I found the solution link

Thremulant
  • 566
  • 5
  • 15