Giter Site home page Giter Site logo

api-google-book-by-react-typescript's Introduction

This project is demonstration on how gather code coverage metrics for unit and Cypress integration tests. The code metrics are also merged.

Running the Application

To run the sample application, enter the following command:

$ npm start

You can access the application by pointing your browser to http://localhost:3000.

Running the unit tests

To run the unit tests, enter this commmand:

$ npm run test

When the tests have completed, a coverage report will be printed in the console. Additionally, you can access the same (and better) report in coverage/jest/lcov-report/index.html. This report contains the same information, but you can also click into the files listed and see what lines are covered.

Running the Cypress Integration Tests

To run the Cypress Integration Tests, run the command:

$ npm run start-test

This command will start the application at port 3000 and then run the Cypress Integration Tests.

When the tests have completed, a coverage report will be available at coverage/cypress/lcov-report/index.html.

You can alternatively run the tests by starting the application (npm start) and in another termnial, run the command npm run cy:run. Additionally, if you want to use the Cypress GUI, use the command npm run cy:open.

Merging the Code Coverage Results

Once you have run the unit tests and Cypress tests, you can merge the code coverage with this command:

$ npm run coverage:merge

You can access the merged code coverage report in coverage/combined/lcov-report/index.html.

Checking the Results

To determine if you code coverage metrics are accetepable, run this command:

$ npm run coverage:check

This commmand will report an ERROR if any of the lines, branhces, statements, or functions metric is below 85 percent. (This number is configurable).

It is recommended to use this command as a step in a CI pipeline.

api-google-book-by-react-typescript's People

Contributors

jonsimon avatar mmtaheri avatar

Stargazers

Doguhan Uluca avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.