Poku
🖇️ A flexible and easy-to-use Test Runner for Node, Bun and Deno, which allows parallel or sequential runs and high isolation level.
Poku starts from the premise where tests come to help, not overcomplicate.
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/wellwelwel/poku/codeql.yml?event=push&style=flat&label=Code%20QL&branch=main)
Why Poku?
Runs test files in an individual process, shows progress and exits 🪄
- Poku is designed to be highly intuitive
- Supports ESM and CJS
- No need to compile TypeScript
- Compatible with Coverage tools
- Allows both in-code and CLI usage
- Zero configurations, except you want
- No constraints or rules, code in your own signature style
- Totally dependency-free
- Poku dive to the deepest depths to find tests in the specified directories
- Compatibility: Poku is tested across all Node 6+, Bun 0.5.3+ and Deno 1.30+ versions
- Poku uses itself to test its own tests using
process.exit
at several depths on the same process node
Install
Node.js
npm install --save-dev poku
TypeScript (Node.js)
npm install --save-dev poku tsx
Bun
bun add --dev poku
Deno
import { poku } from 'npm:poku';
- Poku requires these permissions by default:
--allow-read
, --allow-env
and --allow-run
.
Basic Usage
In-code
import { poku } from 'poku';
await poku(['./a', './b']);
import { poku } from 'npm:poku';
await poku(['./a', './b']);
CLI
npx poku --include='./a,./b'
bun poku --include='./a,./b'
deno run npm:poku --include='./a,./b'
Documentation
Documentation in Progress 🧑🏻🔧
Initially, the documentation is based on Node.js usage, but you can use all the options normally for both Bun and Deno.
poku(string | string[])
Include directories
poku('./targetDir');
poku(['./targetDirA', './targetDirB']);
npx poku --include='./targetDir'
npx poku --include='./targetDirA,./targetDirB'
poku(string | string[], configs: Configs)
filter
Filter by path using Regex to match only the files that should be performed.
poku(['...'], {
filter: /\.test\./,
});
poku(['...'], {
filter: /\.(m)?(j|t)?s$/,
});
npx poku --include='...' --filter='some-file'
npx poku --include='...' --filter='unit'
By using FILTER
from Environment Variable, it will overwrite the filter
option.
FILTER='some-file' npx poku --include='...'
FILTER='unit' npx poku --include='...'
parallel
Determines the mode of test execution across parallelism or sequential modes.
poku(['...'], {
parallel: false,
});
poku(['...'], {
parallel: true,
});
Documentation in Progress...
🧑🏻🎓 Soon documenting all options and Poku's usage variations.