What are the benefits of automated testing of js code? When writing test scripts, developers can better understand the functions and return values of the Code. They can perform accurate and direct tests and immediately see and adjust the test results. In the face of complicated projects, modifications to the Code may trigger the whole body. Changes to the Code may affect the functions of other parts. Automated Testing can help us check the entire process; the test results can be used as a basis for code quality. What are the benefits of automated testing of js code?
1. developers can better understand the functions and return values of code when writing test scripts.
2. perform accurate and direct tests, view the test results immediately, and make adjustments.
3. In the face of complex projects, modifications to the Code may take the whole body, and changes to the Code may affect other functions. Automated Testing can help us check the entire process.
4. Test results can be used as a basis for code quality.
Search for "probe js test" on segmentfault, three articles can be obtained to explain the js test, the first article address: https://segmentfault.com/a/11...
Knowledge needed includes: The BDD test mode, Mocha test framework, and chai assertion library. It is more inclined to use the coverage test tools of objective CT/shold and istanbul,
Here is a brief introduction to http://www.ruanyifeng.com/blo... learn how to use makefileand use supertest to test api interfaces.
Test Item: https://github.com/yylgit/tes...
Project access to the travis Platform
Create a. travis. yml file and file content
language: node_js node_js: - "5" - "4"
Travis executes the test command of scripts in the package.
After access on the travis platform you can see that every time the warehouse has changes re-execute the test, https://travis-ci.org/yylgit...
Each time, travsi tests in a new environment.
Access coverils platform, https://coveralls.io/github/y...
Node project uses node-coverils + istanbul