0
Jest encountered an unexpected token

This usually means that you are trying to import a file that Jest cannot parse, e.g. it's not plain JavaScript.

SyntaxError: Unexpected token export

      1 | import React from 'react'
    > 2 | import { Button, Layout, Icon } from '@ui-kitten/components'
        | ^

I've added this to my Jest config and seen no change, my app should use babel by default as it was made by expo which installed.

"jest": {
    "preset": "jest-expo",
    "transformIgnorePatterns": [
        "/node_modules/(?!@ui-kitten/components)"
    ]
},
suther
  • 12,600
  • 4
  • 62
  • 99
KieranLewin
  • 1,780
  • 2
  • 7
  • 13
  • you need to extend the list of transformIgnorePatterns as described in https://docs.expo.io/versions/latet/guides/testing-with-jest/ :) – brentvatne Feb 14 '20 at 01:35
  • It appears you solution did work for that issue so thank you, but I am getting a new one, for where my app is registering its entry point. If you add your answer in the submission area I will solve this question – KieranLewin Feb 14 '20 at 01:46
  • TypeError: (0 , _expo.registerRootComponent) is not a function – KieranLewin Feb 14 '20 at 01:46
  • you can try posting a reproducible example to https://forums.expo.io – brentvatne Feb 14 '20 at 23:42
  • sorry, broken link, here is the correct one https://docs.expo.io/guides/testing-with-jest – brentvatne Dec 11 '20 at 20:11

1 Answers1

0

you need to extend the list of transformIgnorePatterns as described in docs.expo.io/versions/latet/guides/testing-with-jest :) – brentvatne Feb 14 at 1:35

KieranLewin
  • 1,780
  • 2
  • 7
  • 13