{"id":14967,"library":"test-executor","title":"Node Test Executor","description":"test-executor is a Node.js library, currently at version 1.2.4, designed for executing test scripts and directories of test scripts within a CommonJS (CJS) environment. It was last published to npm approximately 7 years ago, indicating that while it has a semantic version, active development has largely ceased. The library's core mechanism is based on the Async Tree Pattern, which it leverages to manage test execution flow. Its primary dependency is `cutie`. This package offers a straightforward API for running tests by specifying file or directory paths, providing console output for results. Due to its age, it primarily targets older Node.js environments and does not natively support ECMAScript Modules (ESM) syntax or modern testing paradigms.","status":"abandoned","version":"1.2.4","language":"javascript","source_language":"en","source_url":"https://github.com/Guseyn/node-test-executor","tags":["javascript","node","test","executor","cutie","fs"],"install":[{"cmd":"npm install test-executor","lang":"bash","label":"npm"},{"cmd":"yarn add test-executor","lang":"bash","label":"yarn"},{"cmd":"pnpm add test-executor","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core utility dependency; frequently updated in older versions of test-executor according to changelogs.","package":"cutie"}],"imports":[{"note":"This package is CommonJS-only. Attempting to use `import` syntax will result in an `ERR_REQUIRE_ESM` error in an ESM context.","wrong":"import { ExecutedTests } from 'test-executor'","symbol":"ExecutedTests","correct":"const { ExecutedTests } = require('test-executor')"}],"quickstart":{"code":"const { ExecutedTests } = require('test-executor');\n\n// To execute tests from specific files and directories:\nnew ExecutedTests(\n\t'./test/example-test.js',\n\t'./test/my-test-dir/file1.js',\n\t'./test/my-test-dir/file2.js'\n).call();\n\n// Or to execute all tests within a single top-level directory:\n// Note: Ensure './test' exists and contains test files.\n// new ExecutedTests('./test').call();\n\nconsole.log('Test execution initiated. Results will be logged to console.');\n\n// Example of a simple test file (e.g., ./test/example-test.js):\n// module.exports = class ExampleTest {\n//     constructor() {}\n//     testSuccess() { console.assert(true, 'Success!'); }\n//     testFailure() { console.assert(false, 'Failure!'); }\n// };","lang":"javascript","description":"Demonstrates how to initialize and run tests from specified files or directories using the CommonJS `require` syntax."},"warnings":[{"fix":"Ensure your project is configured for CommonJS, or use dynamic `import()` if absolutely necessary within an ESM context, though this is not officially supported and may lead to unexpected behavior. For new projects, consider modern test runners with native ESM support.","message":"This package is CommonJS (CJS) only and does not support ECMAScript Modules (ESM). Trying to import it using `import ... from 'test-executor'` syntax in an ESM project will cause runtime errors.","severity":"breaking","affected_versions":"All versions"},{"fix":"For new projects, evaluate modern, actively maintained test runners. For existing projects, be aware of potential runtime issues with newer Node.js versions or security vulnerabilities that will not be patched.","message":"The package `test-executor` was last published approximately 7 years ago. This indicates it is no longer actively maintained and may have compatibility issues with newer Node.js versions, dependencies, or modern JavaScript features.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Double-check that all paths passed to `new ExecutedTests(...)` accurately point to existing test files or directories that contain test files expected by the executor.","message":"The `ExecutedTests` constructor expects file paths or directory paths as arguments. Incorrect paths will result in no tests being found or executed, without necessarily throwing a clear error about invalid paths.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"This package is CommonJS-only. If your project is ESM, you cannot directly `import` or `require` this package. Consider migrating to a modern test runner or refactoring your project to use CJS if `test-executor` is critical.","cause":"Attempting to `require()` or implicitly load `test-executor` in an ECMAScript Module (ESM) context.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module ...test-executor.js not supported. ..."},{"fix":"Ensure you are using `const { ExecutedTests } = require('test-executor')` and instantiating with `new ExecutedTests(...)`. The default export is not `ExecutedTests` itself.","cause":"Incorrectly trying to instantiate `test-executor` directly, or attempting to destructure a non-existent export.","error":"TypeError: ExecutedTests is not a constructor"},{"fix":"Run `npm install test-executor` or `yarn add test-executor` to install the package. Verify that `node_modules` is present and accessible.","cause":"The `test-executor` package is not installed or cannot be resolved by Node.js.","error":"Error: Cannot find module 'test-executor'"}],"ecosystem":"npm"}