Coder Social home page Coder Social logo

unit-test-ci's Introduction

Unit tesing and CI

The aim of this project is to show the basics of unit testing and GitHub powered continuous integration by the example of doubly linked list.

Installation

This project uses Node.js under the hood. Install using the following command:

Firstly, clone this repository

$ git clone https://github.com/nikolaichub/unit-test-ci.git

Go to project folder

$ cd unit-test-ci

Install all necessary dependencies

$ npm install

Usage

Testing

As this project is all about testing, here's all you need to do.

$ npm test

Example

I am using Mocha framework for clear results output. All the tests are covered by built-in Node.js assert library.

Success

Every test is passed

$ npm test

> mocha tests

  Doubly Linked List
    ✔ should append element
    ✔ should insert element
    ✔ should delete element
    ✔ should delete all elements by value
    ✔ should clone list
    ✔ should reverse list
    ✔ should clear whole list
    ✔ should extend list by another one
    ✔ should return element by id
    ✔ should return list length
    ✔ should return first element by value
    ✔ should return last element by value


  12 passing (13ms)

Fail

Some tests failed

> mocha tests

  Doubly Linked List
    1) should append element
    ✔ should insert element
    ✔ should delete element
    ✔ should delete all elements by value
    ✔ should clone list
    ✔ should reverse list
    ✔ should clear whole list
    ✔ should extend list by another one
    ✔ should return element by id
    ✔ should return list length
    ✔ should return first element by value
    ✔ should return last element by value

  11 passing (13ms)
  1 failing

  1) Doubly Linked List
       should append element:

      AssertionError [ERR_ASSERTION]: Append method addes wrong data
      + expected - actual

      -2
      +1

CI fall

Here is an example of CI fall

Link: e103bfbcb0c12a5170ebe3ab490791c53339df3f

unit-test-ci's People

Contributors

mykolachub avatar

Watchers

 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.