Registry / testing / pta
library1.3.0jsnpmunverified

PTA (v1.3.0) is a CLI test runner designed for programs using the zora testing library. It provides a simple command-line interface to run test files with patterns, supports both CommonJS and ES modules, and offers options like '--only' for focused test runs and '--reporter' (tap, log, default). As a lightweight wrapper around zora (peer dependency ^6), it automates test file discovery with sensible defaults. PTA requires Node.js >= 16. Its key differentiator is being the official zora runner with minimal configuration, unlike other test runners (Jest, AVA) that bundle their own assertion libraries or have complex configuration.

npm install pta
INSTALL
IMPORT
SIG · PTA
P
pta
testingjavascriptv1.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pta (CLI)
pta "test/**/*.js"
npx pta --files "test/**/*.js"
PTA is a CLI tool and not imported in source code; files are specified as positional arguments.
zora (test functions)
import { test } from 'zora'
const { test } = require('zora')
zora is ESM-first; require() may fail depending on module resolution. Use import for consistency.
zora types (TypeScript)
import type { Test } from 'zora'
import { Test } from 'zora'
If using TypeScript, import types separately to avoid runtime overhead.

Installs pta and zora, writes a simple test with zora, then runs all test files via pta CLI.

// Install pta (global or locally) npm install --save-dev pta zora // test/example.test.js import { test } from 'zora'; test('adds numbers', ({ ok }) => { ok(1 + 1 === 2, 'one plus one is two'); }); // Run from terminal (npx if local, or directly if global) pta "test/**/*.js"
Debug
Known issues
gotchaPTA does not watch files by default; no built-in watch mode.
fix
Use a file watcher like nodemon to re-run pta on file changes: nodemon --exec pta
affects: >=1.0.0
gotchaPTA only supports the 'tap' and 'log' reporters; other reporters (e.g., spec, dot) are not available.
fix
Choose one of the supported reporters: --reporter tap or --reporter log, or omit for default.
affects: >=1.0.0
gotchaGlobal installation (npm install -g pta) may cause version conflicts with different projects expecting different pta versions.
fix
Install pta as a dev dependency locally instead of globally.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'zora'
zora (peer dependency) not installed or missing from node_modules.
fix
Install zora: npm install --save-dev zora
SyntaxError: Cannot use import statement outside a module
Test file uses ESM import but package.json lacks {"type": "module"} or uses .mjs extension.
fix
Set "type": "module" in package.json or rename file to .mjs.
ReferenceError: require is not defined in ES module scope
Using require() in an ES module (.mjs or "type": "module") without proper handling.
fix
Replace require() with import statement.
Upgrade
Version history
1.3.0latest on npm
Audit
Dependencies
zorarequiredPeer dependency — PTA runs zora test programs and relies on zora for test execution and assertions.
Agent activity
13 hits · last 30 days
node
12
Amazon
1
Resources
packagepta