我有一个Context provider类Context Consumer,我正在为Context Consumer编写单元测试, 如何在玩笑中模拟Context类的状态
<operatorsContext.Consumer>
{allState => (
<React.Fragment>
{this.context.state.showLoading && (
<Loading width='100px' height='100px' />
)};
</React.Fragment>
)}
</operatorsContext.Consumer>