Why does Jest
fail with \"Unexpected token *\" on a simple import statement...
Admin@Admin-PC MINGW32 /d/project (master)
$ npm
I am using react-native-web and the fix for my issue was to add the react-native-web
preset to my jest.config.js:
module.exports = {
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
timers: 'fake',
testPathIgnorePatterns: [
'/build/',
'/node_modules/',
'/rndemo/build/',
],
globals: {
'ts-jest': {
diagnostics: {
warnOnly: true,
},
},
},
preset: 'react-native-web',
}