Registry / testing / jasmine-json-test-reporter

jasmine-json-test-reporter

JSON →
library1.0.0-betajsnpmunverified

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.

npm install jasmine-json-test-reporter
INSTALL
IMPORT
SIG · JASMINE-JSON-TEST-
J
jasmine-json-test-reporter
testingjavascriptv1.0.0-beta
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

JSONReporter
const JSONReporter = require('jasmine-json-test-reporter');
import { JSONReporter } from 'jasmine-json-test-reporter';
This package is CommonJS-only and does not support ES Modules (import/export syntax).

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 }); });
Debug
Known issues
deprecatedThe `jasmine-json-test-reporter` package is unmaintained and considered abandoned. Its `1.0.0-beta` status indicates it never reached a stable release, and it is not recommended for new projects. Users are strongly advised to migrate.
fix
For new projects, use an actively maintained Jasmine JSON reporter such as `jasmine-ctrf-json-reporter` (npm: `jasmine-ctrf-json-reporter`), which offers similar functionality following a standardized report schema. For existing projects, evaluate the effort to migrate versus the significant risks of using unmaintained software, including security vulnerabilities and compatibility issues.
affects: *
breakingThis package is likely incompatible with modern versions of Jasmine (e.g., Jasmine 3.x, 4.x, or 5.x) and newer Node.js environments due to lack of updates. This can lead to unexpected behavior, runtime errors, or incorrect reporting.
fix
Upgrade to an actively maintained reporter like `jasmine-ctrf-json-reporter` that is designed for current Jasmine and Node.js versions. If migration is not immediately possible, consider pinning older Jasmine/Node.js versions, but be aware of the associated risks.
affects: >=1.0.0-beta (with modern Jasmine/Node.js)
gotchaThis package exclusively uses CommonJS `require()` syntax. It does not support ES Modules (`import`/`export`) natively and will cause 'require is not defined' errors in ES Module-only environments without specific loader configurations or transpilation.
fix
If used in an ES Module project, ensure proper CommonJS interoperability settings (e.g., using `import { createRequire } from 'module'; const require = createRequire(import.meta.url);` in Node.js) or configure your bundler to handle CJS imports. The best long-term solution is to migrate to a modern reporter that supports ES Modules.
affects: >=1.0.0-beta
Errors
Common errors & fixes
ReferenceError: require is not defined in ES module scope
Attempting to use `require()` from this CommonJS-only package in an ES Module context.
fix
In a Node.js ES Module file (e.g., `.mjs` or when `type: "module"` in `package.json`), you can bridge to CommonJS using `import { createRequire } from 'module'; const require = createRequire(import.meta.url);` before using `require('jasmine-json-test-reporter')`. Alternatively, ensure your build setup correctly transpiles CommonJS imports for browser environments, or migrate to a modern ES-module compatible reporter.
Upgrade
Version history
1.0.0-betalatest on npm
Audit
Dependencies
jasminerequiredRuntime dependency as it integrates with Jasmine's reporter API.
Agent activity
4 hits · last 30 days
node
4
Resources
jasmine-json-test-reporter — npm install jasmine-json-test-reporter · libregistry