test-machinepack-mocha is a specialized test driver designed to integrate Mocha with the `node-machine` ecosystem's machinepacks. It enables developers to run tests written in the machinepack's custom JSON format using the familiar Mocha test runner. The package is currently stable at version 3.0.0, but its upstream `node-machine` ecosystem and `test-machinepack-mocha` itself appear to be abandoned, with no significant updates or active development for several years. This means there is no active release cadence. Its key differentiator is its deep integration with `node-machine`'s specific testing methodology, making it suitable only for projects built within that framework. It's primarily used as a command-line interface (CLI) tool rather than being imported programmatically.
npm install test-machinepack-mochaNo compatibility data collected yet for this library.
Demonstrates global installation and usage of the `test-machinepack-mocha` CLI to run a basic test against a sample machinepack.
Consider migrating away from the `node-machine` ecosystem or maintaining a legacy Node.js environment if this package is critical. Manual patching or forks might be necessary for newer environments.
Refer to the `node-machine` documentation (e.g., `machinepack-npm`'s test examples) to understand the required JSON structure for writing tests. Do not attempt to write standard Mocha JS tests directly.
Use `testmachinepack-mocha` directly from the terminal or integrate it into build scripts via `npm run` or shell commands. Avoid trying to `import` or `require` it in your application code.
If encountering issues, try installing an older, compatible version of Mocha (e.g., `npm install mocha@^7`). Pinning `mocha` in `package.json` to an older version might be required.
Install the package globally using `npm install -g test-machinepack-mocha` or run it locally using `npx testmachinepack-mocha` within a project where it's a `devDependency`.
Ensure your test JSON file (e.g., `tests/my-test.json`) includes a `"machine": "./path/to/your/machine.js"` property that correctly references the target machine.
Review the machine's `fn` implementation for runtime errors and verify that the `expect` value in your test JSON matches the expected output of the machine for the given inputs.