Git Product home page Git Product logo

cdp-unit-tests's Introduction

JS Unit Testing

Prerequisites

  1. NODE version >=6.9.1
  2. NPM version >=3.10.8
  3. Gulp (installed globally: > npm i -g gulp )
  4. ESLint (installed globally: > npm i -g eslint )
  5. Git

Run tests

npm test

will create a report folder with:

  • coverage output
  • junit output

Run tests coverage

npm run test:coverage

Run lint

npm run lint

Run mocha tests

npm run test-mocha

Home tasks

1. based on the example in index.js and index.spec.js,

create the Calculator class with defined methods:

  • add - this method should summarize all parameters, that you send to method and return result
  • multiply - this method should multiply all parameters, that you send to method and return result

2. after you finish task 1 please create tests that check how your implemented methods work

3. please create coverage reporter and make a screenshot that later you will attach to your home tasks (in the same way as you did this for git etc.)

4. enable lint task and check the lint errors - also, please make a screenshot of the console and attach it

Advance tasks (not obligatory)

1. based on Jenkins home task set up CI and configure your tests, also as a part of artifacts share your coverage report

2. in the readData.spec.js you will find tests for fileDataManager.js - try to implement TODO

cdp-unit-tests's People

Contributors

aliaksandr-shliayeu avatar

Watchers

 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.