草庐IT

javascript - Jest +酵素。无法读取未定义的属性 '_isMockFunction'。模拟箭头的keyDown

我的主要组件的测试方法存在严重问题。经过多次重试后我的实际测试仍然不起作用,看起来像这样:describe(':',()=>{beforeEach(()=>{wrapper=mount();});describe('Interaction:',()=>{it('shouldcallArrowDown()',()=>{constinstance=wrapper.instance();spy=jest.spyOn(instance,'ArrowDown');instance.forceUpdate();wrapper.simulate('keyDown',{key:'Arrowdown'}