通常来说,JS 开发者不习惯网站开发测试,JS 测试一般会很局限,难以实施,运行慢和写起来费时。
测试类型可以分为很多种,具体可以参考[reference]。但最主要有如下三种:
- 单元测试 Unit Tests- Testing of individual functions or classes by supplying input and making sure the output is as expected.
- 集成测试 Integration Tests- Testing processes or components to behave as expected, including the side effects.