2
我试图用jest(v19.0.2)w/my react native(v0.38.0)项目但是当我运行jest命令时我收到以下错误:语法错误:意外令牌)w/Jest&React原生
● Test suite failed to run
/Users/kyledecot/code/root-react-native/node_modules/react-native/jest/setup.js:40
)
^
SyntaxError: Unexpected token)
at transformAndBuildScript (node_modules/jest-runtime/build/transform.js:320:12)
at handle (node_modules/worker-farm/lib/child/index.js:41:8)
at process.<anonymous> (node_modules/worker-farm/lib/child/index.js:47:3)
at emitTwo (events.js:106:13)
下面是它的抱怨有关文件:
30 .mock('ReactNativeDefaultInjection')
31 .mock('Image',() => mockComponent('Image'))
32 .mock('Text',() => mockComponent('Text'))
33 .mock('TextInput',() => mockComponent('TextInput'))
34 .mock('Modal',() => mockComponent('Modal'))
35 .mock('View',() => mockComponent('View'))
36 .mock('ScrollView',() => mockComponent('ScrollView'))
37 .mock(
38 'ActivityIndicator',
39 () => mockComponent('ActivityIndicator'),
40 )
41 .mock('ListView',() => {
42 const RealListView = require.requireActual('ListView');
43 const ListView = mockComponent('ListView');
44 ListView.prototype.render = RealListView.prototype.render;
45 return ListView;
46 })
47 .mock('ListViewDataSource',() => {
48 const DataSource = require.requireActual('ListViewDataSource');
49 DataSource.prototype.toJSON = function() {
50 function ListViewDataSource(dataBlob) {
有其他人遇到了这个bug或者知道我怎么会去修复它?