[!IMPORTANT]
Poku
v3
is here! 🎉
- To check out what's changed, follow the Issue #801.
- For
v2
documentation, see the previous version's documentation and README.
Why does Poku exist?
💡 Poku is a cross-platform test runner that brings the JavaScript essence back to testing.
High isolation level per file
Performant and lightweight
Auto detect ESM, CJS, and TypeScript files
Run the same test suite for Node.js, Bun, and Deno
Easily handle servers, processes, ports, and even containers ✨
Quickstart
Install
bash
# Node.js
npm i -D poku
|
bash
# TypeScript (Node.js)
npm i -D poku tsx
|
bash
# Bun
bun add -d poku
|
bash
# Deno (optional)
deno add npm:poku
|
Test
test/file.test.mjs |
ts
import { assert } from 'poku';
assert(true, 'Poku will describe it 🐷');
|
Run
Node.js (and TypeScript) |
Bun |
Deno |
bash
npx poku
|
bash
bun poku
|
bash
deno run npm:poku
|
Features
Essentials
poku | 🧪 Test runner. |
assert | 🔍 Test assertion (Node.js familiar API). |
strict | 🔬 Strict test assertion (Node.js familiar API). |
Helpers
test • describe • it | 🤹🏻♀️ Organize, group, and isolate tests. |
envFile | ⚙️ Process an environment file (out-of-box). |
beforeEach • afterEach | 🃏 Hooks for test setup and teardown. |
startScript | 🌐 Run package.json scripts in background. |
startService | 🌐 Run files in background. |
docker | 🐳 Build, start, compose, stop, remove, and test containers. |
kill | 🔌 Terminate ports, port ranges, and PIDs. |
waitForPort | 😴 Wait for specified ports to become active. |
waitForExpectedResult | 🥱 Retry until an expected result or times out. |
skip | ⏭️ Skip tests when necessary. |
only | 🌌 Debug tests by enabling selective runs. |
getPIDs | 🕵🏻 Debug processes IDs using ports and port ranges. |
Common Options
watch | 🍿 Watch for changes and re-run related test files. |
debug | 🕵🏻 Shows all logs. |
config | ⚙️ Customize your Poku options in a config file. |
and much more 👇🏻
Documentation and Examples
To see the detailed documentation, please visit the Documentation and Examples sections in the Poku's website.
Tutorials
Poku offers mini-lessons for different users needs in the Quick Tutorials section.
Common Issues
- Avoiding conflicts in environments with multiple platforms installed.
- Properly running asynchronous tests on the same file.
- Using Poku without installing on Deno and alternatives to JSR.
- Migrating from version 2.x to version 3.x.
Quick Comparisons
Performance
Poku is continuously tested to ensure the following expectations for basic usage:
- ~4x faster than Jest (v29.7.0)
- ~4x faster than Vitest (v3.0.6)
- ~1x faster than Mocha (v11.1.0) — even with test file isolation
- You can see how the tests are run and compared in the benchmark directory.
- Comparing Poku and native test runners (discussion).
Installation Size
Poku size ensures cost-saving CI for services that charge for storage and usage.
Security Policy
Please check the SECURITY.md.
Contributing
See the Contributing Guide and please follow our Code of Conduct 🚀
Acknowledgements
License
Poku is under the MIT License.
Copyright © 2024-present Weslley Araújo and Poku contributors.