Registry / testing / test-executor

test-executor

JSON →
library0.0.12jsnpmunverified

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.

npm install test-executor
INSTALL
IMPORT
SIG · TEST-EXECUTOR
T
test-executor
testingjavascriptv0.0.12
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.

ExecutedTests
const { ExecutedTests } = require('test-executor')
import { ExecutedTests } from 'test-executor'
This package is CommonJS-only. Attempting to use `import` syntax will result in an `ERR_REQUIRE_ESM` error in an ESM context.

Demonstrates how to initialize and run tests from specified files or directories using the CommonJS `require` syntax.

const { ExecutedTests } = require('test-executor'); // To execute tests from specific files and directories: new ExecutedTests( './test/example-test.js', './test/my-test-dir/file1.js', './test/my-test-dir/file2.js' ).call(); // Or to execute all tests within a single top-level directory: // Note: Ensure './test' exists and contains test files. // new ExecutedTests('./test').call(); console.log('Test execution initiated. Results will be logged to console.'); // Example of a simple test file (e.g., ./test/example-test.js): // module.exports = class ExampleTest { // constructor() {} // testSuccess() { console.assert(true, 'Success!'); } // testFailure() { console.assert(false, 'Failure!'); } // };
Debug
Known issues
breakingThis 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.
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.
affects: All versions
gotchaThe 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.
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.
affects: All versions
gotchaThe `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.
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.
affects: All versions
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module ...test-executor.js not supported. ...
Attempting to `require()` or implicitly load `test-executor` in an ECMAScript Module (ESM) context.
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.
TypeError: ExecutedTests is not a constructor
Incorrectly trying to instantiate `test-executor` directly, or attempting to destructure a non-existent export.
fix
Ensure you are using `const { ExecutedTests } = require('test-executor')` and instantiating with `new ExecutedTests(...)`. The default export is not `ExecutedTests` itself.
Error: Cannot find module 'test-executor'
The `test-executor` package is not installed or cannot be resolved by Node.js.
fix
Run `npm install test-executor` or `yarn add test-executor` to install the package. Verify that `node_modules` is present and accessible.
Upgrade
Version history
0.0.12latest on npm
Audit
Dependencies
cutierequiredCore utility dependency; frequently updated in older versions of test-executor according to changelogs.
Agent activity
2 hits · last 30 days
node
2
Resources
test-executor — npm install test-executor · libregistry