通过rekit 初始化创建app,npm test报错
TeresaZhang7517 opened this issue · comments
通过
rekit create ReactApp
npm install
npm test
创建项目之后没有做别的改动,
测试用例报错如下:
` FAIL tests/features/examples/CounterPage.test.js-- expected a string (for built-in components) or a class/function (for composite components) examples/CounterPage
× renders node with correct class name (112ms)
× counter actions are called when buttons clicked (5ms)
● examples/CounterPage › renders node with correct class name
TypeError: Cannot read property 'contextTypes' of undefined
11 | },
12 | };
> 13 | const renderedComponent = shallow(<CounterPage {...props} />);
| ^
14 |
15 | expect(renderedComponent.find('.examples-counter-page').length).toBe(1);
16 | });
at Object.render (node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:693:54)
at new ShallowWrapper (node_modules/enzyme/src/ShallowWrapper.js:411:22)
at shallow (node_modules/enzyme/src/shallow.js:10:10)
at Object.<anonymous> (tests/features/examples/CounterPage.test.js:13:31)
● examples/CounterPage › counter actions are called when buttons clicked
TypeError: Cannot read property 'contextTypes' of undefined
26 | },
27 | };
> 28 | const renderedComponent = shallow(
| ^
29 | <CounterPage {...pageProps} />
30 | );
31 | renderedComponent.find('.btn-plus-one').simulate('click');
at Object.render (node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:693:54)
at new ShallowWrapper (node_modules/enzyme/src/ShallowWrapper.js:411:22)
at shallow (node_modules/enzyme/src/shallow.js:10:10)
at Object.<anonymous> (tests/features/examples/CounterPage.test.js:28:31)
Test Suites: 1 failed, 1 total
Tests: 2 failed, 2 total
Snapshots: 0 total
Time: 7.295s
Ran all test suites matching /CounterPage/i.`
请问这个是什么问题呢?