Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

poku

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

poku

🐷 A flexible and easy-to-use Test Runner for Node, Bun and Deno, which allows parallel or sequential runs and high isolation level

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
369
decreased by-20.99%
Maintainers
1
Weekly downloads
 
Created
Source

Poku

Logo

🖇️ A flexible and easy-to-use Test Runner for Node, Bun and Deno, which allows parallel or sequential runs and high isolation level.

Poku starts from the premise where tests come to help, not overcomplicate.

Node.js Version Bun Version Deno Version NPM Version GitHub Workflow Status (with event) License


Why Poku?

Runs test files in an individual process, shows progress and exits 🪄

  • Poku is designed to be highly intuitive
  • Supports ESM and CJS
  • No need to compile TypeScript
  • Compatible with Coverage tools
  • Allows both in-code and CLI usage
  • Zero configurations, except you want
  • No constraints or rules, code in your own signature style

  • Totally dependency-free.
  • 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.

Install

Node.js

npm install --save-dev poku

TypeScript (Node.js)

npm install --save-dev poku tsx

Bun

bun add --dev poku

Deno

import { poku } from 'npm:poku';
  • Poku requires these permissions by default: --allow-read, --allow-env and --allow-run.

Basic Usage

In-code

import { poku } from 'poku';

await poku(['./a', './b']);
import { poku } from 'npm:poku';

await poku(['./a', './b']);

CLI

npx poku --include='./a,./b'
bun poku --include='./a,./b'
deno run npm:poku --include='./a,./b'

Documentation

Documentation 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(string | string[])

Include directories
poku('./targetDir');
poku(['./targetDirA', './targetDirB']);
npx poku --include='./targetDir'
npx poku --include='./targetDirA,./targetDirB'

poku(string | string[], configs: Configs)

filter

Filter by path using Regex to match only the files that should be performed.

  • in-code
/**
 * @default
 *
 * Testing all `*.test.*` files.
 */

poku(['...'], {
  filter: /\.test\./,
});
/**
 * Testing all `ts`, `js`, `mts` and `mjs` files
 */

poku(['...'], {
  filter: /\.(m)?(j|t)?s$/,
  // filter: /\.(js|ts|mjs|mts)$/,
});
  • CLI
# Testing only a specific file

npx poku --include='...' --filter='some-file'
# Testing only paths that contains "unit"

npx poku --include='...' --filter='unit'
  • Environment Variable

By using FILTER from Environment Variable, it will overwrite the filter option.

# Testing only a specific file

FILTER='some-file' npx poku --include='...'
# Testing only paths that contains "unit"

FILTER='unit' npx poku --include='...'

parallel

Determines the mode of test execution across parallelism or sequential modes.

/**
 * @default
 *
 * Sequential mode
 */

poku(['...'], {
  parallel: false,
});
/**
 * Parallel mode
 */

poku(['...'], {
  parallel: true,
});

Documentation in Progress...

🧑🏻‍🎓 Soon documenting all options and Poku's usage variations.

Keywords

FAQs

Package last updated on 15 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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