Jasmine JSON Test Reporter (Legacy)

1.0.0-beta · abandoned · verified Sun Apr 19

This `jasmine-json-test-reporter` package offers a custom Jasmine reporter designed to output test results to a specified file in JSON format. It was created to provide more detailed and customizable JSON output than Protractor's `resultJsonOutputFile` option, and to allow dynamic assignment of output filenames, a feature not available in Protractor's configuration at the time. The package is currently at version `1.0.0-beta`, indicating it never reached a stable release. It appears to be unmaintained, with no recent updates or active development. For current projects requiring Jasmine JSON reporting, the actively maintained `jasmine-ctrf-json-reporter` (which adheres to the Common Test Report Format standard) is a recommended, modern alternative. This original package is primarily of historical interest or for maintaining legacy systems still reliant on its specific output structure.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to install and configure the JSON reporter with a basic Jasmine test suite, outputting results to `jasmine-test-results.json`.

const JSONReporter = require('jasmine-json-test-reporter');

// Configure and add the reporter to Jasmine
jasmine.getEnv().addReporter(new JSONReporter({
	file: 'jasmine-test-results.json',
	beautify: true,
	indentationLevel: 4 // used if beautify === true
}));

// Example Jasmine spec (assuming it runs after reporter setup)
describe('Example Suite', function() {
    it('should demonstrate a passing test', function() {
        expect(true).toBe(true);
    });
    it('should demonstrate a failing test', function() {
        expect(false).toBe(true); // This will fail
    });
});

view raw JSON →