Detalhes do pacote

poku

wellwelwel2.2kMIT3.0.2

🐷 Poku makes testing easy for Node.js, Bun, Deno, and you at the same time.

🐷, test, runner, assert

readme (leia-me)

Poku's Logo # Poku Enjoying Poku? Give him a star to show your support 🌟 NPM Version NPM Downloads Coverage
GitHub Workflow Status (Linux) GitHub Workflow Status (OSX) GitHub Workflow Status (Windows) --- 🐷 Website  •  📘 Documentation  •  🧪 Examples  •  🧑🏻‍🎓 Tutorials

[!IMPORTANT]

Poku v3 is here! 🎉


Why does Poku exist?

💡 Poku is a cross-platform test runner that brings the JavaScript essence back to testing.

check High isolation level per file
check Performant and lightweight
check Auto detect ESM, CJS, and TypeScript files
check Run the same test suite for Node.js, Bun, and Deno
check Easily handle servers, processes, ports, and even containers


Quickstart

check 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

check Test

test/file.test.mjs
ts import { assert } from 'poku'; assert(true, 'Poku will describe it 🐷');

check Run

Node.js (and TypeScript)
Bun
Deno
bash npx poku bash bun poku bash deno run npm:poku

Features

check Essentials

poku 🧪 Test runner.
assert 🔍 Test assertion (Node.js familiar API).
strict 🔬 Strict test assertion (Node.js familiar API).

check Helpers

testdescribeit 🤹🏻‍♀️ Organize, group, and isolate tests.
envFile ⚙️ Process an environment file (out-of-box).
beforeEachafterEach 🃏 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.

check 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


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

Installation Size

Install Size

Poku size ensures cost-saving CI for services that charge for storage and usage.


Security Policy

GitHub Workflow Status (with event)

Please check the SECURITY.md.


Contributing

See the Contributing Guide and please follow our Code of Conduct 🚀


Acknowledgements

Contributors

Contributors


License

Poku is under the MIT License.
Copyright © 2024-present Weslley Araújo and Poku contributors.

changelog (log de mudanças)

Changelog

3.0.2 (2025-03-19)

Bug Fixes

  • ensure concurrency for multiple inputs (#973) (3902d1c)

3.0.1 (2025-02-05)

Bug Fixes

  • ensure sequential runs respect the previous test's end (#940) (d486f01)

3.0.0 (2025-01-24)

Features

  • introduce custom reporters (poku, dot, compact, focus, verbose, and classic) (#921) (b1feeac)

Miscellaneous Chores

3.0.0-rc.1 (2024-12-23)

Features

  • add stable only modifier to describe, it and test methods (#901) (d6b6241)
  • stable enforce values validation (#905) (3823848)

Performance Improvements

Miscellaneous Chores

3.0.0-rc.0 (2024-12-11)

⚠ BREAKING CHANGES

  • drop support for Node.js v12 (#896)
  • drop platform option (#894)
  • remove allow-hrtime by default for Deno (#892)
  • drop parallel in favor of sequential option (#888)
  • drop support for Node.js v8 and v10 (#885)
  • drop kebab case support (#883)
  • drop include CLI flag (#877)

Performance Improvements

  • use queue instead of groups for parallel tests (#886) (96b8707)

Miscellaneous Chores

2.7.1 (2024-10-27)

Bug Fixes

2.7.0 (2024-09-17)

Features

  • add --help command line option (#765) (bcde009)
  • add only modifier to describe, it and test methods (#767) (7658609)
  • strict: use standard assert for Node.js legacy versions (#761) (d4b7b64)

Bug Fixes

  • deno: ensure --denoCjs respect the current Poku version (#771) (9ead4bc)

2.6.2 (2024-09-10)

Bug Fixes

2.6.1 (2024-09-09)

Bug Fixes

  • allow all combinations of describe, it and test to skip modifier (#746) (c53f3e3)
  • canary: show correct version (#750) (6e8a583)

2.6.0 (2024-09-05)

Features

  • add skip modifier to describe, it and test methods (#735) (b756605)

Bug Fixes

  • improve counter output when using skip and todo (#739) (f5ac8b7)

2.5.0 (2024-08-20)

Features

  • cli: enforce flags validation (#699) (4477de1)
  • cli: support camelCase flags (deprecate kebab-case flags) (#688) (203fb45)

Bug Fixes

  • waitForPort: ensure process exit after Bun v1.1.23 (#689) (85b6b3b)

2.4.4 (2024-08-14)

Bug Fixes

  • make output less verbose (#668) (9623aee)
  • propagate exit code when a failure occurs with --fail-fast (#682) (418a6e5)

2.4.3 (2024-08-08)

Bug Fixes

  • Deno: fix process interoperability after v2.4.2 (#664) (0eb5b9f)

2.4.2 (2024-08-08)

Bug Fixes

  • prevent premature exit after an assertion failure (#662) (32161bb)
  • prevent premature exit of test suite (46d068a)
  • prevent premature exit of test suites (#660) (46d068a)

2.4.1 (2024-08-06)

Bug Fixes

  • sort list of the file paths emitted by --list-files (#657) (2b0528a)

2.4.0 (2024-08-03)

Features

  • add --list-files command line option (#645) (49f6291)
  • add --version command line option (#643) (7051913)
  • allow multiple args and types to log helper (#646) (8f2b6c4)

2.3.0 (2024-08-01)

Features

  • add .todo helper for describe, it, and test (#633) (526112c)

Performance Improvements

  • improve concurrency defaults (inspired by Jest definitions) (#637) (ab01530)

2.2.4 (2024-07-27)

Bug Fixes

  • always use half of available parallelism (#611) (4c3f289)
  • cli: ensure filter and exclude when expanding glob from shell (de9d817)
  • output: always list files at the end of a test run (#616) (bd47ed4)

2.2.3 (2024-07-26)

Bug Fixes

  • prevent 100% CPU usage in large-scale test suites (#606) (382631b)

2.2.2 (2024-07-25)

Bug Fixes

  • ensure afterEach execution after a test failure (#598) (e6654c4)
  • Windows: ensure configuration file loading (js and cjs) (#602) (2d53660)

2.2.1 (2024-07-24)

Bug Fixes

  • async execution order for each helper API (#588) (fb92892)

2.2.0 (2024-07-22)

Features

  • support for short and alternative flags (#568) (ee1800f)

Bug Fixes

2.1.0 (2024-07-20)

Features

  • cli: support for multiple paths in any position (#562) (5ff880b)
  • support for config files (js and cjs) (#560) (368f396)
  • support for config files (json and jsonc) (#557) (e954336)

2.0.0 (2024-07-11)

⚠ BREAKING CHANGES

  • drop beforeEach and afterEach support for each assert (#539)
  • drop assertPromise helper (#538)
  • change listFiles helper from sync to async (#537)
  • drop deprecated methods and options (#536)
  • drop support for Node.js 6 and 7 (#534)

Features

Miscellaneous Chores

  • change listFiles helper from sync to async (#537) (945c4fb)
  • drop assertPromise helper (#538) (954ca1b)
  • drop beforeEach and afterEach support for each assert (#539) (a8455a7)
  • drop deprecated methods and options (#536) (ae6ff4b)
  • drop support for Node.js 6 and 7 (#534) (a11b1b4)

1.23.0 (2024-07-09)

Features

  • add out-of-box support for .env files (#527) (4ef3ecf)

1.22.0 (2024-07-08)

Features

1.21.0 (2024-07-02)

Features

  • watch: reset and rerun all tests by entering rs (#493) (8a27789)

1.20.2 (2024-07-01)

Bug Fixes

  • beforeEach and afterEach: show proper callback name (#490) (812744d)
  • logs: respect quiet option (#492) (aabb1b3)

1.20.1 (2024-06-26)

Bug Fixes

  • beforeEach and afterEach: end with the proper exit code (#471) (716cf5c)
  • recognize .mts and .cts extensions as TS files (#474) (c073ed3)

1.20.0 (2024-06-25)

Features

  • processes: waitForExpectedResult helper (#461) (7e08d59)

Bug Fixes

1.19.0 (2024-06-24)

Features

  • containers: dockerfile and compose API helpers (#442) (ed3d8c6)
  • processes: waitForPort helper (#452) (01751f8)

1.18.0 (2024-06-21)

Features

1.17.1 (2024-06-17)

Bug Fixes

  • assert: Map, Set and Symbol aren't parsed (#405) (9ab7202)

1.17.0 (2024-06-15)

Features

1.16.0 (2024-06-14)

Features

1.15.1 (2024-06-12)

Bug Fixes

  • logs: properly show failures in parallel runs (#382) (964b5a2)

1.15.0 (2024-06-10)

Features

  • cli: show individual and total test execution times (#359) (56f08d0)
  • cli: show paths and options when using --debug (#358) (1c0da5c)
  • describe: support for Node.js familiar API usage (#353) (b423a7e)
  • it: support for Node.js familiar API usage (#354) (c7b2b48)
  • test: support for Node.js familiar API usage (#352) (1c425e1)

Bug Fixes

  • logs: improve output for test, describe and it (#357) (a6facf0)
  • perf: improve validations, recursions, logs and imports (#346) (89bcac3)

1.14.1 (2024-06-05)

Bug Fixes

  • cli: improve performance and indentation (#333) (5efe7d0)
  • cli: show external errors without requiring debugging (#335) (f954089)

1.14.0 (2024-05-29)

Features

  • deno: allow direct CommonJS execution in Deno (#300) (fa358b5)

1.13.0 (2024-05-23)

Features

  • deno: support for custom allow permissions (#284) (4e551f6)
  • deno: support for custom deny permissions (#286) (3172c4b)

1.12.1 (2024-05-19)

Bug Fixes

1.12.0 (2024-05-18)

Features

  • test runner: add concurrency limit option (#260) (58c9dc0)

1.11.0 (2024-05-16)

Features

  • kill, getPIDs: find and kill processes by ports and PIDs (#247) (13305cf)

1.10.2 (2024-05-15)

Bug Fixes

1.10.1 (2024-05-14)

Bug Fixes

  • startScript: disable throw for Bun and Deno (#242) (0619688)

1.10.0 (2024-05-12)

Features

1.9.4 (2024-04-26)

Bug Fixes

  • Windows: adapt for Node.js breaking change (#210) (71d36e9)

1.9.3 (2024-03-24)

Bug Fixes

  • assert: allow custom message for ifError (#147) (7252fd4)
  • Windows, Bun & Deno: startService doesn't ends (#118) (2dd7fe0)

1.9.2 (2024-03-16)

Bug Fixes

  • compatibility: add support for TypeScript 4.7 or higher (#114) (b44f965)
  • conflict when using "eachs" for both test and assert (#117) (68e72eb)

1.9.1 (2024-03-15)

Bug Fixes

  • test runner: ensure all logs when using debug option (#112) (42a1e5e)

1.9.0 (2024-03-10)

Features

  • introduce startScript and startService (#91) (bc414bb)

1.8.1 (2024-03-05)

Bug Fixes

  • Windows: adapt path sanitization and npx.cmd (#80) (a30359d)

1.8.0 (2024-03-04)

Features

1.7.0 (2024-03-03)

Features

1.6.1 (2024-03-01)

Bug Fixes

1.6.0 (2024-02-29)

Features

  • innovating beforeEach and afterEach (#53) (3ea3a12)
  • support target file and directories (#47) (4353996)

1.5.1 (2024-02-28)

Bug Fixes

  • security: sanitize path and prevent shell scripts (#33) (39f7d8c)

1.5.0 (2024-02-26)

Features

Bug Fixes

  • filter: include both .test. and .spec. as default (#27) (9172160)

1.4.0 (2024-02-22)

Features

  • website: introduce Poku's website (#20) (172f081)

1.3.1 (2024-02-20)

Bug Fixes

  • cli: allow no log and log success options (#15) (bff6a15)

1.3.0 (2024-02-19)

Features

1.2.0 (2024-02-18)

Features

Bug Fixes

  • CLI: support parallel option (#9) (f32d20a)

1.1.1 (2024-02-15)

Bug Fixes

  • filter: support multiple files on CLI (#5) (76da3d1)

1.1.0 (2024-02-15)

Features

1.0.0 (2024-02-13)

Features

Bug Fixes

  • process exit on parallel runs (d4da908)
  • types: expose types (696b74d)
  • types: remove tests from compilation (3bc6a65)