New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

poku

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

poku - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

5

package.json
{
"name": "poku",
"version": "1.3.1",
"description": "🐷 Poku is a flexible and easy-to-use Test Runner for Node.js, Bun and Deno that allows you to run parallel and sequential tests, plus high isolation level per test file",
"version": "1.4.0",
"description": "🐷 Poku is your test runner pet for Node.js, Bun and Deno, combining flexibility, parallel and sequential runs, human-friendly assertion errors and high isolation level",
"main": "./lib/index.js",

@@ -26,2 +26,3 @@ "scripts": {

},
"homepage": "https://poku.dev",
"bin": {

@@ -28,0 +29,0 @@ "poku": "./lib/bin/index.js"

457

README.md

@@ -9,2 +9,3 @@ [node-version-url]: https://github.com/nodejs/node

[npm-url]: https://npmjs.org/package/poku
[typescript-url]: https://github.com/microsoft/TypeScript
[ci-url]: https://github.com/wellwelwel/poku/actions/workflows/ci.yml?query=branch%3Amain

@@ -21,3 +22,3 @@ [ci-image]: https://img.shields.io/github/actions/workflow/status/wellwelwel/poku/ci.yml?event=push&style=flat&label=CI&branch=main

A flexible and easy-to-use **Test Runner** for [Node.js][node-version-url], [Bun][bun-version-url] and [Deno][deno-version-url] that allows you to run **parallel** and **sequential** tests, plus **high isolation level per test file**.
**Poku** is your test runner pet for [**Node.js**][node-version-url], [**Bun**][bun-version-url] and [**Deno**][deno-version-url] combining **flexibility**, **parallel** and **sequential** runs, **human-friendly assertion errors** and **high isolation level**.

@@ -32,4 +33,10 @@ [![Node.js Version][node-version-image]][node-version-url]

Enjoying Poku? Consider giving him a star ⭐️
---
🐷 [**Documentation Website**](https://poku.dev)
---
## Why Poku?

@@ -41,3 +48,3 @@

- Designed to be highly intuitive
- No need to compile **TypeScript**
- No need to compile [**TypeScript**][typescript-url] \*
- Compatible with **Coverage** tools

@@ -48,2 +55,3 @@ - Allows both **in-code** and **CLI** usage

- No constraints or rules, code in your own signature style
- [**And much more!**](https://poku.dev)

@@ -54,8 +62,13 @@ ---

- **Zero** external dependencies
- **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
---
## Documentation
- See detailed specifications and usage in [**Documentation**](https://poku.dev/docs/category/documentation) section for queries, advanced concepts and much more.
---
## Overview
| Sequential | Parallel |

@@ -129,3 +142,3 @@ | ------------------------------------------------------------ | ---------------------------------------------------------- |

## Basic Usage
## Quick Start

@@ -174,436 +187,6 @@ ### In-code

## Documentation
To see the detailed documentation, please visit the [**Documentation**](https://poku.dev/docs/category/documentation) section in the [**Poku**'s website](https://poku.dev).
> Website 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(targetDirs: string | string[])`
#### Include directories
- **in-code**
```ts
poku('targetDir');
```
```ts
poku(['targetDirA', 'targetDirB']);
```
- **CLI**
By setting the directories as the last argument:
> _Since **1.3.0**_
```bash
npx poku targetDir
```
```bash
npx poku targetDirA,targetDirB
```
By using `--include` option:
> _Since **1.0.0**_
```bash
npx poku --include='targetDir'
```
```bash
npx poku --include='targetDirA,targetDirB'
```
---
### `poku(targetDirs: string | string[], configs?: Configs)`
#### `parallel: boolean`
Determines the mode of test execution across **sequential** or **parallel** modes.
- **in-code**
```ts
/**
* @default
*
* Sequential mode
*/
poku(['...'], {
parallel: false,
});
```
```ts
/**
* Parallel mode
*/
poku(['...'], {
parallel: true,
});
```
- **CLI**
> _Since **1.2.0**_
```bash
# Parallel mode
npx poku --parallel ./test
```
---
#### `platform: "node" | "bun" | "deno"`
> _Since **1.2.0**_
By default, **Poku** tries to identify the platform automatically, but you can set it manually:
- **in-code**
```ts
/**
* Force Node.js (or tsx for TypeScript)
*
* @default 'node'
*/
poku('...', {
platform: 'node',
});
```
```ts
/**
* Force Bun
*/
poku('...', {
platform: 'bun',
});
```
```ts
/**
* Force Deno
*/
poku('...', {
platform: 'deno',
});
```
- **CLI**
```bash
# Normal
npx poku --platform=node ./test
bun poku --platform=bun ./test
deno run npm:poku --platform=deno ./test
```
```bash
# Custom
# When you're developing using a platform, but maintain compatibility with others
npx poku --platform=bun ./test
bun poku --platform=deno ./test
deno run npm:poku --platform=node ./test
# ...
```
---
#### `filter: RegExp`
By default, **Poku** searches for _`.test.`_ files, but you can customize it using the `filter` option.
> Filter by path using **Regex** to match only the files that should be performed.
- **in-code**
```ts
/**
* @default
*
* Testing all `*.test.*` files.
*/
poku(['...'], {
filter: /\.test\./,
});
```
```ts
/**
* Testing all `ts`, `js`, `mts` and `mjs` files
*/
poku(['...'], {
filter: /\.(m)?(j|t)s$/,
// filter: /\.(js|ts|mjs|mts)$/,
});
```
- **CLI**
```bash
# Testing only a specific file
npx poku --filter='some-file' ./test
```
```bash
# Testing only a specific file
npx poku --filter='some-file|other-file' ./test
```
```bash
# Testing only paths that contains "unit"
npx poku --filter='unit' ./test
```
- **Environment Variable**
> By using `FILTER` from **Environment Variable**, it will overwrite the `filter` option.
```bash
# Testing only a specific file
FILTER='some-file' npx poku ./test
```
```bash
# Testing only a specific file
FILTER='some-file|other-file' npx poku ./test
```
```bash
# Testing only paths that contains "unit"
FILTER='unit' npx poku ./test
```
---
#### `exclude: RegExp | RegExp[]`
> Exclude by path using Regex to match only the files that should be performed.
>
> _Since **1.2.0**_
- **in-code**:
```ts
/**
* Excluding directories from tests
*/
poku(['...'], {
exclude: /\/(helpers|tools)\//,
});
```
```ts
/**
* Excluding directories from tests
*/
poku(['...'], {
exclude: [/\/helpers\//, /\/tools\//],
});
```
```ts
/**
* Excluding specific files from tests
*/
poku(['...'], {
exclude: /(index|common).test.ts/,
});
```
```ts
/**
* Excluding specific files from tests
*/
poku(['...'], {
exclude: [/index.test.ts/, /common.test.ts/],
});
```
```ts
/**
* Excluding directories and files from tests
*/
poku(['...'], {
exclude: /\/(helpers|tools)\/|(index|common).test.ts/,
});
```
```ts
/**
* Excluding directories and files from tests
*/
poku(['...'], {
exclude: [/\/helpers\//, /\/tools\//, /index.test.ts/, /common.test.ts/],
});
```
- **CLI**
```bash
# Excluding directories and files from tests
npx poku --exclude='some-file-or-dir' ./test
```
```bash
# Excluding directories and files from tests
npx poku --exclude='some-file-or-dir|other-file-or-dir' ./test
```
---
#### `quiet`
Perform tests with no logs.
> This option overwrites all `log` settings by exiting with code and no logs (see bellow).
- **in-code**
```ts
poku(['...'], {
quiet: true,
});
```
- **CLI**
> _Since **1.3.1**_
```bash
npx poku --quiet ./test
```
---
#### `log`
##### `success`
By default **Poku** doesn't shows succes logs, but you can enable it:
- **in-code**
```ts
poku(['...'], {
log: {
success: true,
},
});
```
- **CLI**
> _Since **1.3.1**_
```bash
npx poku --log-success ./test
```
---
### Assert
> _Since **1.3.0**_
>
> [**Node.js**][node-version-url], [**Bun**][bun-version-url] and [**Deno**][deno-version-url] compatible.
**Poku** includes the `assert` method native from [**Node.js**][node-version-url], keeping everything as it is, but providing human readability.<br/>
It supports both [**Bun**][bun-version-url] and [**Deno**][deno-version-url].
#### Migrating to **Poku**'s assert
_But only if you want to, of course._
> <img src=".github/assets/readme/node-js.svg" width="24" />
> <img src=".github/assets/readme/plus.svg" width="24" />
> <img src=".github/assets/readme/bun.svg" width="24" />
```diff
- import assert from 'node:assert';
+ import { assert } from 'poku';
assert(true);
```
> <img src=".github/assets/readme/deno.svg" width="24" />
```diff
- import assert from 'node:assert';
+ import { assert } from 'npm:poku';
assert(true);
```
#### Available methods
- `assert(value[, message])`
- `assert.deepEqual(actual, expected[, message])`
- `assert.deepStrictEqual(actual, expected[, message])`
- `assert.doesNotMatch(string, regexp[, message])`
- `assert.doesNotReject(asyncFn[, error][, message])`
- `assert.doesNotThrow(fn[, error][, message])`
- `assert.equal(actual, expected[, message])`
- `assert.fail([message])`
- `assert.ifError(value)`
- `assert.match(string, regexp[, message])`
- `assert.notDeepEqual(actual, expected[, message])`
- `assert.notDeepStrictEqual(actual, expected[, message])`
- `assert.notEqual(actual, expected[, message])`
- `assert.notStrictEqual(actual, expected[, message])`
- `assert.ok(value[, message])`
- `assert.rejects(asyncFn[, error][, message])`
- `assert.strictEqual(actual, expected[, message])`
- `assert.throws(fn[, error][, message])`
You can follow the [**assert documentation**](https://nodejs.org/api/assert.html) from **Node.js**'s documentation.
---
### `listFiles(targetDir: string, configs?: ListFilesConfigs)`
> _Since **1.2.0**_
Returns all files in a directory, independent of their depth.
```ts
listFiles('some-dir');
```
- You can use the `filter` and `exclude` options, as well as they are for **`poku`** method.
---
## Community

@@ -610,0 +193,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc