
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
jasmine-custom-reporters
Advanced tools
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.
To install use npm i jasmine-custom-reporters
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
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
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
--------------------------------------
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
--------------------------------------
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
//--------------------------------
// 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
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
<!-- -------------------------------- -->
<!-- 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 -->
FAQs
Custom reporters for jasmine or protractor frameworks
We found that jasmine-custom-reporters demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.