Why does Poku exist?
๐ก Poku makes testing easy and brings the native JavaScript syntax back to tests, letting you to write tests intuitively โ just like in real JavaScript code.
No configurations
ย ย ย ย ย Auto detect ESM, CJS, and TypeScript files
ย ย ย ย ย Run the same test suite for Node.js, Bun, and Deno
Easier and Less Verbose
ย ย ย ย ย Node.js familiar API
ย ย ย ย ย Instantly re-run related tests in watch
mode
ย ย ย ย ย Run CJS (CommonJS) files directly with Deno
ย ย ย ย ย Easily handle containers, servers, services, processes, and ports
Safety and Reliability
ย ย ย ย ย High isolation level per file
ย ย ย ย ย Performant and lightweight
ย ย ย ย ย Compatible with coverage tools
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
|
Try the flag --parallel
to run tests in parallel.
Available Methods
Essentials
Helpers
- test, describe and it (organize, group, and isolate tests)
- beforeEach and afterEach (hooks for test setup and teardown)
- docker (build, start, compose, stop, remove, and test containers)
- startScript (run package.json scripts in background)
- startService (run files in background)
- kill (terminate ports, port ranges, and PIDs)
- waitForPort (wait for specified ports to become active)
- waitForExpectedResult (retry until an expected result or times out)
- getPIDs (debug processes IDs using ports and port ranges)
Common Options
- 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
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
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
License
Poku is under the MIT License.