JS test and access CI Guide

Source: Internet
Author: User
Tags writing test scripts
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.