How to achieve the front end application unit test

Front-end engineering is an important means of modern front-end to enhance the efficiency and code quality. As a means to protect the unit test code quality, to enhance the maintainability of the front end more and more applied.

In this paper, the front end of the mainstream Vue framework, and lead us to build unit tests in the front-end applications, and demonstrates how to Vue single-file assemblies for testing. We hope that by telling the paper, give hope to learn how to make the front end of a small partner in unit testing helps front-end applications.

Chat this field you will learn the following:

  1. Understand the significance of unit tests
  2. How to use karma, mocha set up unit testing
  3. Use mocha, chai, @ vue / test-utils write test cases
  4. Use karma-coverage, babel-plugin-istanbul conduct coverage tests

Read more: http://gitbook.cn/gitchat/activity/5d038b3ffbc8d375c9959b15

A field watching too much trouble? GitChat become members and enjoy 1000+ games Chat! Click to view

Guess you like

Origin blog.csdn.net/valada/article/details/92852345