![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
jest+enzyme debug
tangtang_coding_03
这个作者很懒,什么都没留下…
展开
-
jest mock的一些思路
基本场景可参考:https://www.cnblogs.com/SamWeb/p/11454923.htmlmock的其他方式:https://jestjs.io/docs/zh-Hans/mock-function-api#mockfnmockrejectedvaluevalue其他场景:需要mock一个promise或者函数多层回调时,可参考: ...原创 2020-07-23 17:47:13 · 1506 阅读 · 0 评论 -
jest+enzyme针对 react16+ typescript UT代码的debug方法
在 Jest 单测中进行 debugger 目前有两种方法:1. VSCode 提供的 Debugger 功能;2. Chrome Node DevTools针对第一种,直接上链接:https://github.com/microsoft/vscode-recipes/tree/master/debugging-jest-tests其中:Add following Jest configuration to package.json:"jest": { "testEnviron原创 2020-07-22 16:59:39 · 521 阅读 · 0 评论