Do I need a unit-testing framework if I'm already using Cypress in a Vue.js app?

扶醉桌前 提交于 2020-01-14 09:21:10

问题


When scaffolding a new project with the Vue.js CLI, it offers a choice of both unit-testing and E2E-testing frameworks.

Unit-testing functionality is perfectly adequate in Cypress. My question, then: is there an advantage to using a distinct unit-testing framework if I'm already using Cypress?


回答1:


There is a third-party adapter made by a Cypress contributor here called cypress-vue-unit-test(along with unit-test adapters for other popular frameworks).

You should check that out and see if it meets your needs over, say, Jest

From this tutorial about unit testing vuejs, some Jest advantages over Cypress are:

  • Built in code coverage
  • Snapshot testing
  • Module mocking utilities

Also see repo for vue-test-utils



来源:https://stackoverflow.com/questions/54764650/do-i-need-a-unit-testing-framework-if-im-already-using-cypress-in-a-vue-js-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!