Code Monkey home page Code Monkey logo

jest's Introduction

Quality Gate Status

Framework of Automated Tests with Jest and StrykerJs

To consolidate the knowledge that I have been acquiring on the subject, I created this practical example of an automated unit/mutation testing framework built with Jest and StrykerJs.

I created a function to validate whether the user can drive, based on age and a valid driver's license. I consider, for instance, that a person can get a driver's license at the age of 18 and beyond.

I used the equivalence partitioning and boundary value analysis to devise the basic test cases:

  1. Age of 17
  2. Age of 18 and no valid driver's license
  3. Age of 18 and a valid driver's license
  4. Age of 19 and no valid driver's license
  5. Age of 19 and a valid driver's license

The project is already configured to run the test coverage.

Requirements

Tools:

Installation

Run npm i to install the dev dependencies.

Running unit tests via command line

To run the tests via the command line of all test classes in the project:

npm run test

Running mutation tests via command line

To run the tests via the command line of all test classes in the project:

npm run mutation

Report

Running the tests make the application generates a test coverage report

jest's People

Contributors

rafaabc avatar

Stargazers

Manoel avatar Danilo Feijó avatar André Kunitz  avatar Nathan avatar Misael Reis avatar

Watchers

James Cloos avatar  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.