有没有办法在不使用酶的情况下模拟单位测试中的状态
我一直在使用开玩笑,并且一直在阅读 @testing-library/react文档,但到目前为止,没有发现与React中的模拟状态有关。我知道酶在反应中的嘲笑状态是可能的。但是我正在使用React 18,此版本没有酶适配器。我对单元测试非常新鲜,很想就此提出一些建议。
I've been using jest and have been reading through the @testing-library/react docs but so far found nothing relating to mocking state in react. I know mocking state in react is possible with enzyme. But I'm using react 18 and there is no enzyme-adapter for this version. I'm quite new to unit testing and would love to get some suggestions on this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论