Node Test Executor

1.2.4 · abandoned · verified Sun Apr 19

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.

Common errors

Warnings

Install

Imports

Quickstart

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!'); }
// };

view raw JSON →