Testing with React's Jest and Enzyme when simulated clicks call a function that calls a promise
问题 React v15.1.0 Jest v12.1.1 Enzyme v2.3.0 I'm trying to figure out how to test a component that calls a promise in a function invoked by a click. I was expecting Jest's runAllTicks() function to help me out here, but it doesn't seem to be executing the promise. Component: import React from 'react'; import Promise from 'bluebird'; function doSomethingWithAPromise() { return new Promise((resolve) => { setTimeout(() => { resolve(); }, 50); }); } export default class AsyncTest extends React