LoginSignup
0
0

More than 5 years have passed since last update.

expoでJest使ってテストしようとするとunexpected tokenでしばかれる

Last updated at Posted at 2019-05-07

jest.config.jsに

module.exports = {
  preset: 'jest-expo',
  transform: {
    '\\.js$': '<rootDir>/node_modules/react-native/jest/preprocessor.js'
  }
};

こいつをねじこむといいらしい。(jest-expoは入ってる前提で)

追記:

module.exports = {
  preset: 'jest-expo',
  transform: {
    '\\.js$': '<rootDir>/node_modules/react-native/jest/preprocessor.js',
    '\\.tsx$': '<rootDir>/node_modules/react-native/jest/preprocessor.js'
  }
};

割と当然だけどTypeScriptでtsxとかの拡張子使ってる時にとかしないとエラーが出る

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0