{"id":14639,"library":"jasmine-json-test-reporter","title":"Jasmine JSON Test Reporter (Legacy)","description":"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.","status":"abandoned","version":"1.0.0-beta","language":"javascript","source_language":"en","source_url":"https://github.com/DrewML/jasmine-json-test-reporter","tags":["javascript","JSON","jasmine","protractor","reporter","tests"],"install":[{"cmd":"npm install jasmine-json-test-reporter","lang":"bash","label":"npm"},{"cmd":"yarn add jasmine-json-test-reporter","lang":"bash","label":"yarn"},{"cmd":"pnpm add jasmine-json-test-reporter","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime dependency as it integrates with Jasmine's reporter API.","package":"jasmine","optional":false}],"imports":[{"note":"This package is CommonJS-only and does not support ES Modules (import/export syntax).","wrong":"import { JSONReporter } from 'jasmine-json-test-reporter';","symbol":"JSONReporter","correct":"const JSONReporter = require('jasmine-json-test-reporter');"}],"quickstart":{"code":"const JSONReporter = require('jasmine-json-test-reporter');\n\n// Configure and add the reporter to Jasmine\njasmine.getEnv().addReporter(new JSONReporter({\n\tfile: 'jasmine-test-results.json',\n\tbeautify: true,\n\tindentationLevel: 4 // used if beautify === true\n}));\n\n// Example Jasmine spec (assuming it runs after reporter setup)\ndescribe('Example Suite', function() {\n    it('should demonstrate a passing test', function() {\n        expect(true).toBe(true);\n    });\n    it('should demonstrate a failing test', function() {\n        expect(false).toBe(true); // This will fail\n    });\n});\n","lang":"javascript","description":"Demonstrates how to install and configure the JSON reporter with a basic Jasmine test suite, outputting results to `jasmine-test-results.json`."},"warnings":[{"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.","message":"The `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.","severity":"deprecated","affected_versions":"*"},{"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.","message":"This 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.","severity":"breaking","affected_versions":">=1.0.0-beta (with modern Jasmine/Node.js)"},{"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.","message":"This 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.","severity":"gotcha","affected_versions":">=1.0.0-beta"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"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.","cause":"Attempting to use `require()` from this CommonJS-only package in an ES Module context.","error":"ReferenceError: require is not defined in ES module scope"}],"ecosystem":"npm"}