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-reporterVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to install and configure the JSON reporter with a basic Jasmine test suite, outputting results to `jasmine-test-results.json`.
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.
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.
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.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.