在使用 React Testing Library (RTL) 测试使用了 Context API 的 React 组件时,你可能会遇到一个问题:是否需要在测试中用 Context Provider 包裹你的组件? 答案是:通常情况下, ...