📅  最后修改于: 2022-03-11 14:59:21.538000             🧑  作者: Mango
const spy = jest.spyOn(Component.prototype, 'methodName');
const wrapper = mount( );
wrapper.instance().methodName();
expect(spy).toHaveBeenCalled();