-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
单元测试 #56
Comments
值得学习的blog |
React 单元测试究竟在测试什么
|
React 组件测试在测试什么 通过对内部 DOM 对象属性以及内容等,测试组件逻辑是否符合预期 |
通过组件库学习单元测试 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
为什么要做单元测试
如果你说我的业务部门不需要频繁上线,并且我有足够的人力来覆盖手工测试,那你可以不用单元测试
如果你说我不在意代码腐化,并且我也不做重构,那你可以不用单元测试
如果你说我不在意代码质量,好几个没有测试保护的 if-else 裸奔也不在话下,脑不好还做什么程序员,那你可以不用单元测试
如果你说我确有快速部署的需求,但我们不 care 质量问题,出回归问题就修,那你可以不用单元测试
除此之外,你就需要写单元测试。如果你想随时整理重构代码,那么你需要写单元测试;如果你想有自动化的测试套件来帮你快速验证提交的完整性,那么你需要写单元测试。
综上,我用以谈单元测试的「透镜」是什么呢?一言以蔽之,两点:反馈速度和自动化。
The text was updated successfully, but these errors were encountered: