mocha_JavaScript unit testing framework

mocha
mocha is a unit testing framework for JavaScript, both can run in a browser environment, it can also run in Node.js environment.
Use mocha, we only need to focus on writing unit tests themselves, then let mocha to run all the tests automatically and the test results are given.
mocha features are:
  1. Either test a simple JavaScript function, and can test asynchronous code, because asynchronous JavaScript is one of the characteristics;
  2. All tests can be run automatically, you can only run a specific test;
  3. You can support before, after, beforeEach and afterEach writing initialization code.
  4. Mocha test to run continuously, allowing for flexible and accurate reporting, while uncaught exceptions mapped to the correct test cases.
We will explain in detail how to use mocha writing automated tests, and how to test asynchronous code.
Liao Xuefeng Tutorial:
 
Official website:

Guess you like

Origin www.cnblogs.com/TomBombadil/p/11121966.html