{"id":14907,"library":"seneca-error-test","title":"Seneca Error Test Utility","description":"seneca-error-test is an internal utility package primarily designed for testing error handling mechanisms within the Seneca microservices framework. Released at version 0.2.2, it explicitly states compatibility with Node.js 0.10.31 and Seneca 0.6.0. These are very old versions of both Node.js and Seneca, indicating that the package has not seen active development or maintenance for many years. Consequently, it is highly unlikely to be compatible with modern Node.js versions (v14+) or current stable releases of Seneca (v3+). Its release cadence is effectively zero, as it has remained at 0.2.2 since its initial publication. As an internal test utility, it offers minimal user-facing functionality beyond its specific testing purpose, serving more as a historical artifact or a reference for older Seneca implementations rather than a viable tool for contemporary projects. Its use in new projects is strongly discouraged due to potential compatibility issues and lack of security updates.","status":"abandoned","version":"0.2.2","language":"javascript","source_language":"en","source_url":"https://github.com/rjrodger/seneca-error-test","tags":["javascript","seneca","error","test"],"install":[{"cmd":"npm install seneca-error-test","lang":"bash","label":"npm"},{"cmd":"yarn add seneca-error-test","lang":"bash","label":"yarn"},{"cmd":"pnpm add seneca-error-test","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package is a Seneca plugin and requires the Seneca framework to function. It was tested against Seneca 0.6.0.","package":"seneca","optional":false}],"imports":[{"note":"This package exports a CommonJS function intended to be registered as a Seneca plugin. It is not an ES module.","symbol":"senecaErrorTestPlugin","correct":"const senecaErrorTestPlugin = require('seneca-error-test')"}],"quickstart":{"code":"const Seneca = require('seneca')\nconst senecaErrorTestPlugin = require('seneca-error-test')\n\nasync function runErrorTest() {\n  const seneca = Seneca({ log: 'silent' })\n  // Register the error test plugin\n  seneca.use(senecaErrorTestPlugin)\n\n  try {\n    // Call a command designed to fail\n    const result = await seneca.post('role:error-test,cmd:fail')\n    console.log('Unexpected success:', result)\n  } catch (err) {\n    console.error('Caught expected error:', err.message)\n  }\n\n  try {\n    // Call a command that returns an error object\n    const result = await seneca.post('role:error-test,cmd:errobj,arg:testvalue')\n    // In older Seneca, this might not throw but return an object with error properties\n    console.log('Result from errobj (may contain error details):', result)\n  } catch (err) {\n    console.error('Caught error from errobj:', err.message)\n  }\n\n  await seneca.close()\n}\n\nrunErrorTest()","lang":"javascript","description":"Demonstrates initializing a Seneca instance, loading the seneca-error-test plugin, and invoking a 'fail' command to catch an expected error."},"warnings":[{"fix":"Do not use this package in new projects or with modern environments. Consider creating a new test utility specific to your current Seneca version.","message":"This package was explicitly tested with Node.js 0.10.31 and Seneca 0.6.0. It is highly incompatible with modern Node.js versions (v14+) and Seneca versions (v3+) due to significant API changes and JavaScript syntax evolution.","severity":"breaking","affected_versions":">=0.2.2"},{"fix":"Migrate away from this package. If its functionality is required, reimplement it for your current Seneca setup.","message":"The package has not been updated since its 0.2.2 release and is effectively abandoned. There is no active maintenance, bug fixes, or security patches planned.","severity":"deprecated","affected_versions":">=0.2.2"},{"fix":"Thoroughly test any integration with modern Seneca. Expect refactoring or complete replacement to be necessary.","message":"Using this package with newer Seneca instances may lead to silent failures, unexpected behavior, or TypeErrors due to deprecated Seneca API calls (e.g., `seneca.add` signatures).","severity":"gotcha","affected_versions":">=0.2.2"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure your `seneca` package version matches the expectations of the plugin (Seneca 0.6.0 for this package). For modern Seneca, you cannot directly use this plugin without modification.","cause":"Attempting to use an old version of the Seneca framework, or an old plugin with a newer Seneca instance where the `seneca.add` signature has changed significantly.","error":"TypeError: seneca.add is not a function"},{"fix":"Ensure your project is configured for CommonJS if using old packages, or use a bundler that handles CJS to ESM conversion if necessary. For this package, directly `require()`ing it is the intended method.","cause":"While this package is CommonJS, if it were part of a larger project attempting to use ESM-only dependencies or being imported into an ESM context without proper transpilation/bundling, this error could occur.","error":"ERR_REQUIRE_ESM: require() of ES Module ... not supported"},{"fix":"Run `npm install seneca-error-test` or `yarn add seneca-error-test` to install it.","cause":"The package is not installed, or the path in `require()` is incorrect.","error":"Cannot find module 'seneca-error-test'"}],"ecosystem":"npm"}