Git Product home page Git Product logo

js-and-jest's Introduction

js-and-jest

Basic test for ES2017 and Jest knowledge

Definition

The default export of this repository module (index.js) returns a function workersGenerator that generates an async worker function that returns an integer after some random delay.

  1. workersGenerator sets maximum delay for each generated worker function to random value 0..MAX_DURATION
  2. workersGenerator sets maximum of return value to a random value 0..MAX_POWER
  3. Resulted worker function returns an integer value up to maximum value generated in [2] after delay up to time in ms generated in [1]
  4. Worker function will throw ZeroError immediately if resulted random value is equal to 0.
  5. Worker function will throw HalfError after half of delay generated in [3] if resulted value is half of maximum generated in [3].
  6. Worker function will throw BingoError if resulted value is exactly maximum value generated in [3]

Exercise

Please implement following:

  • Implement benchmarks that out of 100 generated workers will find following statistics:
    1. Fastest worker
    2. Average workers delay
    3. Average workers result value
    4. Maximum workers delay
    5. Maximum workers result value
  • Your benchmark must output results as HTML formatted file.
  • Your benchmark must have 100% code coverage using Jest.

js-and-jest's People

Contributors

vyatkin0 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.