Why does Poku exist?
๐ก Poku makes testing easy and brings the native JavaScript syntax back to tests, letting you to write tests intuitively.
No configurations
ย ย ย ย ย
Auto detect ESM, CJS, and TypeScript files
ย ย ย ย ย
Run the same test suite for Node.js, Bun, and Deno
Easier and Less Verbose
ย ย ย ย ย
Run CJS (CommonJS) files directly with Deno
ย ย ย ย ย
Easily handle containers, servers, processes, and ports
Safety and Reliability
ย ย ย ย ย
High isolation level per file
ย ย ย ย ย
Performant and lightweight
Quickstart
Install
Node.js | TypeScript (Node.js) | Bun | Deno |
npm i -D poku
|
npm i -D poku tsx
|
bun add -d poku
|
deno add npm:poku
|
Test
test/file.test.mjs
|
import { assert } from 'poku';
assert(true, 'Poku will describe it ๐ท');
|
Run
Node.js (and TypeScript) | Bun | Deno |
npx poku
|
bunx poku
|
deno run npm:poku
|
Features
Essentials
Name | Description |
---|
poku | ๐งช Test runner. |
assert | ๐ Test assertion (Node.js familiar API). |
strict | ๐ฌ Strict test assertion (Node.js familiar API). |
Helpers
Name | Description |
---|
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. |
getPIDs | ๐ต๐ป Debug processes IDs using ports and port ranges. |
Common Options
Name | Description |
---|
watch | ๐ฟ Watch for changes and re-run related test files. |
parallel | ๐๐ปโโ๏ธ Run tests in parallel. |
debug | ๐ต๐ป Shows all logs. |
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
Contributing
See the Contributing Guide and please follow our Code of Conduct ๐
Security Policy
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/wellwelwel/poku/ci_codeql.yml?event=push&label=&branch=main&logo=github&logoColor=white)
Please check the SECURITY.md.
Quick Comparisons
Performance
Poku is continuously tested to ensure the following expectations for basic usage:
- ~4x faster than Jest (v29.7.0)
- ~3x faster than Vitest (v1.6.0)
- ~1x faster than Mocha (v10.4.0) + Chai (v5.1.1)
You can see how the tests are run and compared in the benchmark directory.
Installation Size
![Install Size](https://packagephobia.com/badge?p=poku)
Poku size is highly significant in development to ensure cost-saving CI that require servers that charge for storage and usage.
Limitations
- Although it has no external dependencies, Poku is not all-in-one, so it doesn't have integrated features such as mocks, spies, coverage reports, etc., where you can use your favorite packages or native solutions.
- Poku doesn't render components (such as Angular, React, etc.).
- Our community is gradually building up.
Acknowledgements
![Contributors](https://img.shields.io/github/contributors/wellwelwel/poku)
![Contributors](https://opencollective.com/poku/contributors.svg?width=890&button=false)
License
Poku is under the MIT License.