嗨,我一直在尝试运行'npm test'面对像本机这样的几个问题,但通过在我的包中的transformIgnorePatterns键中放置'native-base-shoutem-theme ||| tcomb-form-native'来解决. json文件.
但是还没有找到react-native-vector-icons的解决方案,如下所示
myapp@0.0.1 test D:\ReactWorkSpace\myapp
jest
PASS tests\index.ios.js
FAIL tests\index.android.js
? Test suite failed to run
D:\ReactWorkSpace\myapp\node_modules\native-base\node_modules\react-native-vector-icons\Ionicons.js:6
import createIconSet from './lib/create-icon-set';
^^^^^^
SyntaxError: Unexpected token import
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/ScriptTransformer.js:289:17)
at Object.<anonymous> (node_modules/native-base/dist/src/basic/IconNB.js:5:15)
at Object.<anonymous> (node_modules/native-base/dist/src/index.js:16:13)
Test Suites: 1 failed, 1 passed, 2 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 3.189s, estimated 8s
Ran all test suites.
npm ERR! Test failed. See above for more details
Run Code Online (Sandbox Code Playgroud)
我的package.json文件是
{
"name": "myapp",
"version": "0.0.1",
"private": true, …Run Code Online (Sandbox Code Playgroud)