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 - npm Package Compare versions

Comparing version 0.2.0 to 1.0.0

6

lib/bin/index.js
#! /usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const escape_reg_exp_js_1 = require("../helpers/escape-reg-exp.js");
const get_arg_js_1 = require("../helpers/get-arg.js");
const index_js_1 = require("../index.js");
const rawDirs = (0, get_arg_js_1.getArg)('include');
const rawFilter = (0, get_arg_js_1.getArg)('filter');
const dirs = (rawDirs === null || rawDirs === void 0 ? void 0 : rawDirs.split(',')) || [];
(0, index_js_1.poku)(dirs);
(0, index_js_1.poku)(dirs, {
filter: rawFilter ? new RegExp((0, escape_reg_exp_js_1.escapeRegExp)(rawFilter)) : undefined,
});

2

lib/helpers/get-arg.d.ts

@@ -1,1 +0,1 @@

export declare const getArg: (arg: string) => string | null;
export declare const getArg: (arg: string) => string | undefined;

@@ -9,5 +9,5 @@ "use strict";

if (getArg)
return ((_a = getArg.split('=')) === null || _a === void 0 ? void 0 : _a[1]) || null;
return null;
return ((_a = getArg.split('=')) === null || _a === void 0 ? void 0 : _a[1]) || undefined;
return undefined;
};
exports.getArg = getArg;
export { poku } from './modules/poku.js';
export { exit } from './modules/exit.js';
export type { Code } from './@types/code.js';
export type { Configs } from './@types/poku.js';
{
"name": "poku",
"version": "0.2.0",
"description": "🐷 A flexible and easy-to-use Test Runner for parallel and concurrent runs using high isolation level",
"version": "1.0.0",
"description": "🐷 A flexible and easy-to-use Test Runner for parallel or sequential runs and high isolation level",
"main": "./lib/index.js",

@@ -37,3 +37,6 @@ "scripts": {

"concurrent",
"concurrency",
"parallelism",
"parallel",
"sequential",
"unit",

@@ -40,0 +43,0 @@ "integration",

@@ -5,4 +5,6 @@ [npm-image]: https://img.shields.io/npm/v/poku.svg?color=f78fb3

[ci-image]: https://img.shields.io/github/actions/workflow/status/wellwelwel/poku/ci.yml?event=push&style=flat&label=ci&branch=main&color=badc58
[license-url]: https://github.com/wellwelwel/poku/blob/main/License
[license-url]: https://github.com/wellwelwel/poku/blob/main/LICENSE
[license-image]: https://img.shields.io/npm/l/poku.svg?maxAge=2592000&color=3dc1d3
[node-version-image]: https://img.shields.io/node/v/poku.svg?color=ffb142
[node-version-url]: https://nodejs.org/en/download

@@ -13,7 +15,8 @@ # Poku

🖇️ A flexible and easy-to-use **Test Runner** for parallel or concurrent runs and high isolation level.
🖇️ A flexible and easy-to-use **Test Runner** for parallel or sequential runs and high isolation level.
[![NPM Version][npm-image]][npm-url]
[![Node.js Version][node-version-image]][node-version-url]
[![GitHub Workflow Status (with event)][ci-image]][ci-url]
[![License][license-image]][license-url]
[![GitHub Workflow Status (with event)][ci-image]][ci-url]

@@ -24,13 +27,16 @@ ---

> 🪄 Runs test files in an individual process, shows progress and exits.<br/>
🪄 Runs test files in an individual process, shows progress and exits.<br/>
- **Poku** is designed to be highly intuitive.<br />
- Works with **Node.js 6** to **Latest** (_ESM_ and _CJS_), **TypeScript** (_no need to build_) and **Coverage** tools.<br />
- Poku dive to the deepest depths to find tests in the specified directories.
- **Unleash creativity:** No constraints or predefined paths. Code in your own signature style.
- **No environment restrictions:** **Poku** is strongly tested on all Node versions from **6** onwards.
- As an example, **Poku** uses itself to test its own tests in different depths using several `process.exit` in the same node process.
- Supports **Node.js 6+** (_ESM_ and _CJS_), **TypeScript** (_no need to build_) and **Coverage** tools.<br />
- **Poku** dive to the deepest depths to find tests in the specified directories.
- No constraints or rules, code in your own signature style.
- Zero configurations, except you want.
- Use both **in-code** and **CLI** usage.
- Allows both **in-code** and **CLI** usage.
---
- Totally **dependency-free**.
- **Compatibility:** **Poku** is tested across all **Node 6+** versions.
- **Poku** uses itself to test its own tests using `process.exit` at several depths on the same process node.

@@ -60,3 +66,3 @@ ---

```bash
npx poku --include='./a,./b';
npx poku --include='./a,./b'
```

@@ -66,3 +72,3 @@

## TypeScript
### TypeScript

@@ -77,5 +83,117 @@ To run your tests without compile, just install `tsx` and it's done:

## In progress
## Documentation
> 🧑🏻‍🔧 Soon releasing version `1.x`.<br />
### `poku`
#### Include directories
```ts
poku('./targetDir');
```
```ts
poku(['./targetDirA', './targetDirB']);
```
```bash
npx poku --include='./targetDir'
```
```bash
npx poku --include='./targetDirA,./targetDirB'
```
---
#### `filter`
> 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 --include='...' --filter='some-file'
```
```bash
# 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.
```bash
# Testing only a specific file
FILTER='some-file' npx poku --include='...'
```
```bash
# Testing only paths that contains "unit"
FILTER='unit' npx poku --include='...'
```
---
#### `parallel`
Determines the mode of test execution across **parallelism** or **sequential** modes.
```ts
/**
* @default
*
* Sequential mode
*/
poku(['...'], {
parallel: false,
});
```
```ts
/**
* Parallel mode
*/
poku(['...'], {
parallel: true,
});
```
---
## Documentation in Progress
> 🧑🏻‍🎓 Soon documenting all options and **Poku**'s usage variations.
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