Skip to content

added jest unit testing for metrics functions

Fixes #68 (closed)

Short description of what this resolves:

add jest unit testing for the metrics calculation functions in profile.js which are to getTotalCitations, Hindex, Gindex, Mindex, Oindex, Eindex and H-Median respectively. It supports code coverage out of the box and is a very useful metric for all CI-based delivery pipelines and overall test effectiveness of a project.

Changes proposed in this pull request:

  • done unit testing individually using jest for all metrics calculation functions
  • Jest being a JavaScript testing framework is designed to ensure correctness of any JavaScript code-base and thus it allows to write tests with an approachable, familiar and feature-rich API that gives results quickly thatswhy all tests have been passed and executed.
  • Jest is well-documented, requires little configuration and can be extended to match requirements. Therefore it also provides detailed coverage of all the passed and failed tests which have been shown in this MR by running npm test.

Checklist

  • My branch is up-to-date with the Upstream develop branch.
  • The acceptance, integration, unit tests and linter pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Merge request reports