我为Syncfusion柱形图创建了组件,并尝试使用JEST(react-test-renderer)对我的代码进行单元测试,但出现错误。 TypeError:无法读取未定义的属性“ getRandomValues”
TypeError: Cannot read property 'getRandomValues' of undefined
31 | describe('<Column />', () => {
32 | test('Column changes the class when hovered', () => {
> 33 | const component = renderer.create(
| ^
34 | <Column data={data1} chartProp={chartProp1} />,
35 | );
36 | const tree = component.toJSON();
at m (node_modules/@syncfusion/ej2-base/dist/ej2-base.umd.min.js:10:2061)
at e.r [as constructor] (node_modules/@syncfusion/ej2-base/dist/ej2-base.umd.min.js:10:72492)
at e.o [as constructor] (node_modules/@syncfusion/ej2-charts/dist/ej2-charts.umd.min.js:10:137363)
at new e (node_modules/@syncfusion/ej2-react-charts/dist/ej2-react-charts.umd.min.js:20:8204)
at constructClassInstance (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:4833:18)
at updateClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6685:5)
at beginWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7540:16)
at performUnitOfWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10358:12)
at workLoop (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10390:24)
at renderRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10476:7)
at performWorkOnRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11342:7)
at performWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11254:7)
at performSyncWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11228:3)
at requestWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11097:5)
at scheduleWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10907:5)
at scheduleRootUpdate (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11494:3)
at updateContainerAtExpirationTime (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11522:10)
at updateContainer (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11533:10)
at Object.create (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:12079:5)
at Object.create (src/lib/charts/column/Column.test.jsx:33:36)