npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

jasmine-custom-reporters

v1.2.1

Published

Custom reporters for jasmine or protractor frameworks

Readme

jasmine-custom-reporters

Jasmine reporters are used to report the results of the test case executed. Jasmine or protractor can be configured so that the result of the tests excution are customized as per our need. More on this in the following sections.

Installation

To install use npm i jasmine-custom-reporters

Module structure

  jasmine-custom-reporters
    ├──spec-console-reporter # Module .js file to report the tests result to console
    ├──spec-json-reporter # Module .js file to report the tests result to JSON file
    ├──spec-xml-reporter # Module .js file to report the tests result to XML file
    ├──package.json # Config .json file for the module

Import

To import the specific custom reporter use require(jasmine-custom-reporters/[**]) for example to import json reporter use require(jasmine-custom-reporters/spec-console-reporter) similary remaining reporters

Usage

Using Console reporter

Console reporter is used to report the tests result to the console.

  var consoleReporter = require(`jasmine-custom-reporters/spec-console-reporter`);
  //jasmine.getEnv().clearReporters() # use this statement to clear default reporters 
  jasmine.getEnv().addReporter(consoleReporter); //  Add this statement to proctractor config file in onPrepare function

Resulted console output

  --------------------------------------
          Begin of tests Run
  --------------------------------------

  Started Executing test cases @ 10/18/2017, 4:27:09 PM

  Total specs defined = 2
  Current testing suite = angularjs homepage todo list

          should add a todo       3.307s

  Current testing suite = angularjs homepage todo list 2

          should add a todo       1.898s

  End of executing test cases @ 10/18/2017, 4:27:15 PM

  Finished in 5.218

  --------------------------------------
          End of tests Run
  --------------------------------------

Using Json reporter

Json reporter is used to report the tests result to json file

  var JSONReporter = require(`jasmine-custom-reporters/spec-json-reporter`);
  var jsonReporter = new JSONReporter('path-to-your-file.json');
  //jasmine.getEnv().clearReporters() // use this statement to clear default reporters
  jasmine.getEnv().addReporter(jsonReporter); // Add this statement to proctractor config file in onPrepare function

Resulted JSON

  //--------------------------------
  //     Begin of tests Run         
  //--------------------------------
  //Started Executing test cases @ 10/18/2017, 4:27:09 PM
  //Total specs defined = 2
  {
    "angularjs homepage todo list": [
      {
        "id": "spec0",
        "description": "should add a todo",
        "fullName": "angularjs homepage todo list should add a todo",
        "failedExpectations": [],
        "passedExpectations": [
          {
            "matcherName": "toEqual",
            "message": "Passed.",
            "stack": "",
            "passed": true
          },
          {
            "matcherName": "toEqual",
            "message": "Passed.",
            "stack": "",
            "passed": true
          },
          {
            "matcherName": "toEqual",
            "message": "Passed.",
            "stack": "",
            "passed": true
          }
        ],
        "pendingReason": "",
        "status": "passed"
      }
    ],
    "angularjs homepage todo list 2": [
      {
        "id": "spec1",
        "description": "should add a todo",
        "fullName": "angularjs homepage todo list 2 should add a todo",
        "failedExpectations": [],
        "passedExpectations": [
          {
            "matcherName": "toEqual",
            "message": "Passed.",
            "stack": "",
            "passed": true
          },
          {
            "matcherName": "toEqual",
            "message": "Passed.",
            "stack": "",
            "passed": true
          },
          {
            "matcherName": "toEqual",
            "message": "Passed.",
            "stack": "",
            "passed": true
          }
        ],
        "pendingReason": "",
        "status": "passed"
      }
    ]
  }
  //--------------------------------
  //     End of tests Run           
  //--------------------------------
  //Finshed Executing test cases @ 10/18/2017, 4:27:15 PM
  //Tota time taken = 5.214

Using XML reporter

XML reporter is used to report the tests result to XML file

  var XMLReporter = require(`jasmine-custom-reporters/spec-XML-reporter`);
  var xmlReporter = new JSONReporter('path-to-your-file.xml');
  //jasmine.getEnv().clearReporters() // use this statement to clear default reporters
  jasmine.getEnv().addReporter(xmlReporter); // Add this statement to proctractor config file in onPrepare function

Resulted JSON

  <!-- -------------------------------- -->
  <!--    Begin of tests Run            -->
  <!-- -------------------------------- -->
  <!-- Started Executing test cases @ 10/18/2017, 4:27:09 PM -->
  <!-- Total specs defined = 2 -->
  <xml>
    <suite>
      <desc>angularjs homepage todo list</desc>
      <spec>
        <id>spec0</id>
        <description>should add a todo</description>
        <fullName>angularjs homepage todo list should add a todo</fullName>
        <failedExpectations>
        </failedExpectations>
        <passedExpectations>
          <expect>
            <matcherName>toEqual</matcherName>
            <message>Passed.</message>
            <stack></stack>
          <expect>
          <expect>
            <matcherName>toEqual</matcherName>
            <message>Passed.</message>
            <stack></stack>
          <expect>
          <expect>
            <matcherName>toEqual</matcherName>
            <message>Passed.</message>
            <stack></stack>
          <expect>
        </passedExpectations>
        <pendingReason></pendingReason>
        <status>passed</status>
      </spec>
    </suite>
    <suite>
      <desc>angularjs homepage todo list 2</desc>
      <spec>
        <id>spec1</id>
        <description>should add a todo</description>
        <fullName>angularjs homepage todo list 2 should add a todo</fullName>
        <failedExpectations>
        </failedExpectations>
        <passedExpectations>
          <expect>
            <matcherName>toEqual</matcherName>
            <message>Passed.</message>
            <stack></stack>
          <expect>
          <expect>
            <matcherName>toEqual</matcherName>
            <message>Passed.</message>
            <stack></stack>
          <expect>
          <expect>
            <matcherName>toEqual</matcherName>
            <message>Passed.</message>
            <stack></stack>
          <expect>
        </passedExpectations>
        <pendingReason></pendingReason>
        <status>passed</status>
      </spec>
    </suite>
  </xml>
  <!-- -------------------------------- -->
  <!--    End of tests Run              -->
  <!-- -------------------------------- -->
  <!-- Finshed Executing test cases @ 10/18/2017, 4:27:15 PM -->
  <!-- Tota time taken = 5.214 -->