@@ -80,10 +80,11 @@ By creating **Poku**, my aim is to show that testing can be simpler 🌱
> 🔬 Start by seeing how to use `assert`
+> 🧑🏻🔬 Need to test an API? Check the `startService` and `startScript`
> 🧪 Then learn how to use `poku` CLI to run all your test files at once
> 🧙🏻 So, just if you want to, go deeper into learning about **Poku**
>
-> 🩵 Take your time
+> 🩵 Take Your Time
- [**Compare Poku with the Most Popular Test Runners 🧪**](/docs/comparing)
@@ -129,8 +130,7 @@ You can also use **Poku** with [**esm.sh**](https://esm.sh):
import { poku } from 'https://esm.sh/poku';
```
-
-
+
### **Test it** 🔬
@@ -156,6 +156,8 @@ assert(true, 'Poku will describe it 🐷');
+> Note that these examples use [**ESM**](/docs/examples/cjs-esm), but you can use [**CJS**](/docs/examples/cjs-esm) as well.
+
### **Run it** 🚀
@@ -198,13 +200,14 @@ deno run npm:poku
### Essentials
-- `poku` (_test runner_)
-- `assert` and `assertPromise` (_test assertion_)
+- [**poku**](/docs/category/poku) (_test runner_)
+- [**assert**](/docs/documentation/assert) (_test assertion_)
+- [**startScript**](/docs/documentation/startScript) and [**startService**](/docs/documentation/startService) (_run scripts and services in a background process_)
### Helpers
-- `beforeEach` and `afterEach`
- `test`
+- `beforeEach` and `afterEach`
- `describe` and `log`
- `listFiles`
- `exit`
@@ -215,7 +218,7 @@ deno run npm:poku
## Documentation
-> Initially, the [**documentation**](/docs/category/documentation) and [**examples**](/docs/category/examples) are based on **Node.js** usage, but you can use all the options normally for both **Bun** and **Deno**.
+> Initially, the [**documentation**](/docs/category/documentation) and [**examples**](/docs/category/examples) are based on **Node.js** and **ESM** usage, but you can use all the options normally for both **Bun** and **Deno**, including **CJS**.
diff --git a/website/docs/overview.mdx b/website/docs/overview.mdx
index 0fa5f538..9d36d477 100644
--- a/website/docs/overview.mdx
+++ b/website/docs/overview.mdx
@@ -13,7 +13,7 @@ import ASSERT_NODE from '@site/static/img/assert-node.png';
| | |
- By default, **Poku**:
- - Searches for all _`.test.`_ and `.spec.` files, but you can customize it using the option [**`filter`**](/docs/documentation/poku/configs/filter).
+ - Searches for all _`.test.`_ and `.spec.` files, but you can customize it using the option [**`filter`**](/docs/documentation/poku/options/filter).
- Uses `sequential` mode.
- You can use concurrecy by using the flag `--parallel` for **CLI** or setting the option `parallel` to `true` in **API** (_in-code_) usage.
diff --git a/website/docs/security.mdx b/website/docs/security.mdx
index 62cdff6c..3c113769 100644
--- a/website/docs/security.mdx
+++ b/website/docs/security.mdx
@@ -15,7 +15,7 @@ Some test runners use **`eval`**, **Poku** prefers to use **`spawn`** to create
- `\` for **Windows**
- `/` for **Linux** and **macOS**
- Normalizes paths by filtering unusual path characters, for example:
- - `<>:|^?*`
+ - `<>|^?*`
- Prevents shell scripts by setting `shell` to `false` in **`spawn`** options, ensuring that only secure arguments will be used.
- Every **RegExp** is prev-tested using the [**ReDoS Checker**](https://devina.io/redos-checker).
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/assert/index.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/assert/index.mdx
deleted file mode 100644
index c5432caa..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/assert/index.mdx
+++ /dev/null
@@ -1,96 +0,0 @@
----
-sidebar_position: 2
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-# `assert`
-
-**Poku** includes the `assert` method native from [**Node.js**][node-version-url], keeping everything as it is, but providing human readability.
-It supports both [**Bun**][bun-version-url] and [**Deno**][deno-version-url].
-
-[node-version-url]: https://github.com/nodejs/node
-[bun-version-url]: https://github.com/oven-sh/bun
-[deno-version-url]: https://github.com/denoland/deno
-
-- [**Node.js**][node-version-url], [**Bun**][bun-version-url] and [**Deno**][deno-version-url] compatible.
-
-> The `assert` is used to write tests and verify if your code works as expected by comparing values and throwing errors, otherwise 🧑🏻🎓
->
-> _Since **1.3.0**_
-
-## Migrating to **Poku**'s `assert`
-
-_But only if you want to, of course._
-
-
-
-
- ```diff
- - import assert from 'node:assert';
- + import { assert } from 'poku';
- ```
-
-
-
-
- ```diff
- - import assert from 'node:assert';
- + import { assert } from 'npm:poku';
- ```
-
-
-
-
-```ts
-assert(true);
-assert.deepStrictEqual(1, '1', 'My optional custom message');
-// ...
-```
-
-:::tip
-**Poku**'s `assert` will use the message exactly as it is when using `describe` and `it`.
-Your **Poku** is waiting for you 🐷✨
-:::
-
-
-
-## Available methods
-
-```ts
-import { assert, assertPromise } from 'poku';
-```
-
-> You can combine promise **assert** with beforeEach and afterEach helpers.
-
-- `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.
-
-:::info
-
-To use `assert` with **TypeScript**, you may will need to instal **@types/node**:
-
-```bash
-npm i -D @types/node
-```
-
-:::
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/_category_.json b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/_category_.json
deleted file mode 100644
index cc6797db..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "Helpers",
- "collapsed": false,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/before-after-each/_category_.json b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/before-after-each/_category_.json
deleted file mode 100644
index 93043d1d..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/before-after-each/_category_.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "label": "beforeEach and afterEach",
- "collapsed": true,
- "link": {
- "type": "generated-index"
- },
- "position": 2
-}
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/before-after-each/in-code.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/before-after-each/in-code.mdx
deleted file mode 100644
index cce908f0..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/before-after-each/in-code.mdx
+++ /dev/null
@@ -1,255 +0,0 @@
----
-sidebar_position: 2
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-# In-Code
-
-## How can I combine `beforeEach`, `afterEach` and `assert`?
-
-Both `beforeEach`, `afterEach` are recommended for tests that consume a particular global state for each test.
-For example, by populating or resetting a database before and/or after multiple assertions.
-
-### See how Poku solve it 🧙🏻
-
-
-
-
- ```ts
- import { assert, beforeEach, afterEach } from 'poku';
-
- const prepareService = () => true;
- const resetService = () => true;
-
- beforeEach(() => prepareService());
- afterEach(() => resetService());
-
- assert(true, 'Test A');
- assert(true, 'Test B');
- assert(true, 'Test C');
- assert(true, 'Test D');
- ```
-
-:::tip
-
-- ✅ Handling **global** and **external** services (_preparing a database, for example_)
-- ✅ It's made for **exclusive use** in combination with **Poku**'s **`assert`** methods
-- ✅ You can combine `beforeEach`, `afterEach` and all `assert` methods, except for `assert.fail(message?: string)`.
-
-:::
-
-:::info
-
-- Although `beforeEach` and `afterEach` accepts local variables changes, it's strongly encouraged ([_you can use a mock instead_](/docs/category/mock)).
-
-See why (_note the `immediate` option_):
-
-```ts
-import { assert, beforeEach, afterEach } from 'poku';
-
-let value = 0;
-
-beforeEach(() => ++value, { immediate: true });
-afterEach(() => ++value);
-
-assert.equal(value, 1); // ✅
-assert.equal(value, 3); // ✅
-
-// ✋ In the `eachBefore` context, `value` is now `4`, while locally it's `5`
-console.log(value);
-```
-
-:::
-
-
-
-
- ```ts
- import { assert } from 'poku';
-
- const prepareService = () => true;
- const resetService = () => true;
-
- prepareService();
- assert(true, 'Test A');
- resetService();
-
- prepareService();
- assert(true, 'Test B');
- resetService();
-
- prepareService();
- assert(true, 'Test C');
- resetService();
-
- prepareService();
- assert(true, 'Test D');
- resetService();
- ```
-
-
-
-
-**Poku** provides three optional methods from both `beforeEach` and `afterEach`:
-
- - `.pause()`
- - `.continue()`
- - `.reset()`
-
- ```ts
- import { assert, beforeEach, afterEach } from 'poku';
-
- const prepareService = () => true;
- const resetService = () => true;
-
- const before = beforeEach(() => prepareService());
- const after = afterEach(() => resetService());
-
- assert.ok(true, 'Test A');
- assert.ok(true, 'Test B');
-
- before.pause();
-
- assert.ok(true, 'Test C');
- assert.ok(true, 'Test D');
-
- before.continue();
-
- assert.ok(true, 'Test E');
-
- // From now, it will not run beforeEach until you declare it again.
- before.reset();
-
- assert.ok(true, 'Test F');
- ```
-
-:::tip
-You can overwriting both `beforeEach` and `afterEach` by declaring them again anytime.
-:::
-
-
-
-
-### By using Promises
-
-
-
-
- ```ts
- import { assertPromise as assert, beforeEach, afterEach } from 'poku';
-
- const prepareService = () => new Promise((resolve) => resolve(true));
- const resetService = () => new Promise((resolve) => resolve(true));
-
- beforeEach(async () => await prepareService());
- afterEach(async () => await resetService());
-
- await assert(true, 'Test A');
- await assert(true, 'Test B');
- await assert(true, 'Test C');
- await assert(true, 'Test D');
- ```
-
-:::tip
-
-- ✅ Handling **global** and **external** services (_preparing a database, for example_)
-- ✅ It's made for **exclusive use** in combination with **Poku**'s **`assert`** methods
-- ✅ You can combine `beforeEach`, `afterEach` and all `assert` methods, except for `assert.fail(message?: string)`.
-
-:::
-
-:::info
-
-- Although `beforeEach` and `afterEach` accepts local variables changes, it's strongly encouraged ([_you can use a mock instead_](/docs/category/mock)).
-
-See why (_note the `immediate` option_):
-
-```ts
-import { assertPromise as assert, beforeEach, afterEach } from 'poku';
-
-let value = 0;
-
-beforeEach(async () => new Promise((resolve) => resolve(++value)), {
- immediate: true,
-});
-afterEach(async () => new Promise((resolve) => resolve(++value)));
-
-await assert.equal(value, 1); // ✅
-await assert.equal(value, 3); // ✅
-
-// ✋ In the `eachBefore` context, `value` is now `4`, while locally it's `5`
-console.log(value);
-```
-
-:::
-
-
-
-
- ```ts
- import { assert } from 'poku';
-
- const prepareService = () => new Promise((resolve) => resolve(true));
- const resetService = () => new Promise((resolve) => resolve(true));
-
- await prepareService();
- assert(true, 'Test A');
- await resetService();
-
- await prepareService();
- assert(true, 'Test B');
- await resetService();
-
- await prepareService();
- assert(true, 'Test C');
- await resetService();
-
- await prepareService();
- assert(true, 'Test D');
- await resetService();
- ```
-
-
-
-
- **Poku** provides three optional methods from both `beforeEach` and `afterEach`:
-
- - `.pause()`
- - `.continue()`
- - `.reset()`
-
- ```ts
- import { assertPromise as assert, beforeEach, afterEach } from 'poku';
-
- const prepareService = () => new Promise((resolve) => resolve(true));
- const resetService = () => new Promise((resolve) => resolve(true));
-
- const before = await beforeEach(async () => await prepareService());
- const after = await afterEach(async () => await resetService());
-
- await assert.ok(true, 'Test A');
- await assert.ok(true, 'Test B');
-
- before.pause();
-
- await assert.ok(true, 'Test C');
- await assert.ok(true, 'Test D');
-
- before.continue();
-
- await assert.ok(true, 'Test E');
-
- // From now, it will not run beforeEach until you declare it again.
- before.reset();
-
- await assert.ok(true, 'Test F');
- ```
-
-:::tip
-You can overwriting both `beforeEach` and `afterEach` by declaring them again anytime.
-:::
-
-
-
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/before-after-each/per-file.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/before-after-each/per-file.mdx
deleted file mode 100644
index 6a1083f0..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/before-after-each/per-file.mdx
+++ /dev/null
@@ -1,58 +0,0 @@
----
-sidebar_position: 1
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-import { FAQ } from '@site/src/components/FAQ';
-import Success from '@site/static/img/each-success.png';
-import Failure from '@site/static/img/each-fail.png';
-
-# Per File
-
-## Running a callback before and after each test file
-
-- [x] `poku` **API (_in-code_)**
-- [ ] `poku` **CLI**
-
-**Poku** brings a simple way to perform a callback before and/or after every test file.
-
-
-
-
- ```ts
- import { poku } from 'poku';
-
- const prepareService = () => new Promise((resolve) => resolve(undefined));
- const resetService = () => new Promise((_, reject) => reject('Let\'s crash it'));
-
- await poku('test/unit', {
- beforeEach: prepareService,
- afterEach: resetService,
- });
- ```
-
- ```bash
- npx poku test/run.test.js
- ```
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-:::info
-Although it also works with `parallel` runs, it's strongly discouraged to use these features for sequential tests.
-:::
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/describe.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/describe.mdx
deleted file mode 100644
index 8fc16509..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/describe.mdx
+++ /dev/null
@@ -1,124 +0,0 @@
----
-sidebar_position: 1
----
-
-import { FAQ } from '@site/src/components/FAQ';
-import Example from '@site/static/img/describe-example.png';
-
-# describe
-
-On **Poku**, `describe` is just a pretty `console.log` to title your test suites in the terminal.
-
-```ts
-import { describe, assert } from 'poku';
-
-describe('Group A');
-assert(true, '1');
-assert(true, '2');
-
-describe('Group B');
-assert(true, '1');
-assert(true, '2');
-```
-
-## Personalization
-
-> `describe(title: string, options?: DescribeOptions)`
-
-### pad
-
-Skips a line before to console it.
-
-```ts
-import { describe, assert } from 'poku';
-
-describe('Group A', { pad: true });
-assert.ok(true, '1');
-assert.ok(true, '2');
-```
-
-### background
-
-Change the background color for your personal title.
-
-> Set `false` to disable it.
-
-```ts
-import { describe, assert } from 'poku';
-
-describe('Group A', { background: 'blue' });
-assert.ok(true, '1');
-assert.ok(true, '2');
-```
-
-
-
-- `white`
-- `black`
-- `grey`
-- `red`
-- `green`
-- `yellow`
-- `blue`
-- `magenta`
-- `cyan`
-- `brightRed`
-- `brightGreen`
-- `brightYellow`
-- `brightBlue`
-- `brightMagenta`
-- `brightCyan`
-
-
-
-### icon (prefix)
-
-**Poku** also allows the prefix customization.
-
-> The default icon is `☰`.
-
-```ts
-import { describe, assert } from 'poku';
-
-describe('Group A', { icon: '🚀' });
-assert.ok(true, '1');
-assert.ok(true, '2');
-```
-
-
-
-## Overview
-
-
-
- ```ts
- import { assert, describe } from 'poku';
-
- describe('Needs to Succeed', {
- pad: true,
- background: false,
- icon: '🚀',
- });
-
- assert.ok(true, 'Test 1');
- assert.ok(true, 'Test 2');
-
- describe('Needs to Fail', {
- pad: true,
- background: 'yellow',
- icon: '🚫',
- });
-
- assert.throws(() => { throw new Error() }, 'Test 1');
- assert.throws(() => { throw new Error() }, 'Test 2');
- ```
-
-
-
-
-
-
-
- |
-
-
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/list-files.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/list-files.mdx
deleted file mode 100644
index 88285cfe..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/list-files.mdx
+++ /dev/null
@@ -1,23 +0,0 @@
-# `listFiles`
-
-> `listFiles(targetDir: string, configs?: ListFilesConfigs)`
-
-Returns all files in a directory, independent of their depth.
-
-> _Since **1.2.0**_
-
-```ts
-listFiles('some-dir');
-```
-
-- You can use the `filter` and `exclude` options, as well as they are for **`poku`** method.
-
-:::info
-
-To use `listFiles` with **TypeScript**, you will need to instal **@types/node**:
-
-```bash
-npm i -D @types/node
-```
-
-:::
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/log.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/log.mdx
deleted file mode 100644
index 009c1639..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/log.mdx
+++ /dev/null
@@ -1,19 +0,0 @@
----
-sidebar_position: 3
----
-
-# log
-
-Since by default **Poku** only shows outputs generated from itself, this helper allows you to use an alternative to `console.log` with **Poku** runner.
-
-```ts
-import { log } from 'poku';
-
-log('Poku will show it');
-
-console.log("Poku won't show that");
-```
-
-:::tip
-Need to debug? Just use the [`debug`](/docs/documentation/poku/configs/debug) option from `poku`.
-:::
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/debug.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/debug.mdx
deleted file mode 100644
index cc5efb07..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/debug.mdx
+++ /dev/null
@@ -1,27 +0,0 @@
----
-sidebar_position: 6
----
-
-# `debug`
-
-> `poku(targetPaths: string | string[], configs?: Configs)`
->
-> `debug: boolean`
-
-By default **Poku** doesn't shows logs that doesn't comes from **Poku**'s **`assert`**, but you can enable them:
-
-> _Since **1.5.0**_
-
-## API (_in-code_)
-
-```ts
-poku(['...'], {
- debug: true,
-});
-```
-
-## CLI
-
-```bash
-npx poku --debug ./test
-```
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/exclude.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/exclude.mdx
deleted file mode 100644
index 4e1656f7..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/exclude.mdx
+++ /dev/null
@@ -1,89 +0,0 @@
----
-sidebar_position: 4
----
-
-# `exclude`
-
-> `poku(targetPaths: string | string[], configs?: Configs)`
->
-> `exclude: RegExp | RegExp[]`
-
-Exclude by path using Regex to match only the files that should be performed.
-
-> _Since **1.2.0**_
-
-## API (_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
-```
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/filter.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/filter.mdx
deleted file mode 100644
index 7d8c97c1..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/filter.mdx
+++ /dev/null
@@ -1,85 +0,0 @@
----
-sidebar_position: 2
----
-
-# `filter`
-
-> `poku(targetPaths: string | string[], configs?: Configs)`
->
-> `filter: RegExp`
-
-Filter by path using **Regex** to match only the files that should be performed.
-By default, **Poku** searches for _`.test.`_ and `.spec.` files, but you can customize it using the `filter` option.
-
-## API (_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
-```
-
-```bash
-# Testing only paths that contains "unit" by using Poku as a NPM script
-
-FILTER='unit' npm run tests
-```
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/no-exit.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/no-exit.mdx
deleted file mode 100644
index bcf57767..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/no-exit.mdx
+++ /dev/null
@@ -1,39 +0,0 @@
----
-sidebar_position: 7
----
-
-# `noExit`
-
-> `poku(targetPaths: string | string[], configs?: Configs)`
->
-> `noExit: boolean`
-
-By setting `noExit` to `true`, **Poku** won't exit the process and will return the exit code (`0` or `1`).
-You can combine this option with **Poku**'s `exit` method or just use the result, for example: `process.exit(code)`.
-
-## API (_in-code_)
-
-```ts
-import { poku, exit } from 'poku';
-
-const unit = await poku('test/unit', {
- noExit: true,
- parallel: true,
- quiet: true,
-});
-
-// do something
-
-const integration = await poku('test/integration', {
- noExit: true,
- quiet: true,
-});
-
-// do something more
-
-const code = unit === 0 && integration === 0 ? 0 : 1;
-
-// do something more again
-
-exit(code);
-```
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/parallel.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/parallel.mdx
deleted file mode 100644
index ad6f3c62..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/parallel.mdx
+++ /dev/null
@@ -1,41 +0,0 @@
----
-sidebar_position: 1
----
-
-# `parallel`
-
-> `poku(targetPaths: string | string[], configs?: Configs)`
->
-> `parallel: boolean`
-
-## API (_in-code_)
-
-```ts
-/**
- * @default
- *
- * Sequential mode
- */
-
-poku(['...'], {
- parallel: false,
-});
-```
-
-```ts
-/**
- * Parallel mode
- */
-
-poku(['...'], {
- parallel: true,
-});
-```
-
-## CLI
-
-```bash
-# Parallel mode
-
-npx poku --parallel ./test
-```
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/platform.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/platform.mdx
deleted file mode 100644
index 6937bdbe..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/platform.mdx
+++ /dev/null
@@ -1,72 +0,0 @@
----
-sidebar_position: 3
----
-
-# `platform`
-
-> `poku(targetPaths: string | string[], configs?: Configs)`
->
-> `platform: "node" | "bun" | "deno"`
-
-> _Since **1.2.0**_
-
-By default, **Poku** tries to identify the platform automatically, but you can set it manually:
-
-## API (_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
-
-# ...
-```
-
-:::tip
-Useful when there is more than one common platform installed.
-:::
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/quiet.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/quiet.mdx
deleted file mode 100644
index 8984a43c..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/configs/quiet.mdx
+++ /dev/null
@@ -1,28 +0,0 @@
----
-sidebar_position: 5
----
-
-# `quiet`
-
-> `poku(targetPaths: string | string[], configs?: Configs)`
->
-> `quiet: boolean`
-
-Perform tests with no logs.
-This option overwrites all `log` settings by exiting with code and no logs (see bellow).
-
-## API (_in-code_)
-
-```ts
-poku(['...'], {
- quiet: true,
-});
-```
-
-## CLI
-
-> _Since **1.3.1**_
-
-```bash
-npx poku --quiet ./test
-```
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/include-files.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/include-files.mdx
deleted file mode 100644
index 99643476..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/include-files.mdx
+++ /dev/null
@@ -1,56 +0,0 @@
----
-sidebar_position: 1
----
-
-# Include Directories and Files
-
-> `poku(targetPaths: string | string[])`
->
-> By default, **Poku** searches for _`.test.`_ and `.spec.` files, but you can customize it using the [`filter`](/docs/documentation/poku/configs/filter) option.
-
-## API (_in-code_)
-
-```ts
-poku('targetePath');
-```
-
-```ts
-poku(['targetePathA', 'targetePathB']);
-```
-
-```ts
-poku('./');
-```
-
-## CLI
-
-By setting the directories as the **last argument**:
-
-> _Since **1.3.0**_
-
-```bash
-npx poku targetePath
-```
-
-```bash
-npx poku targetePathA,targetePathB
-```
-
-```bash
-# Same as ./
-npx poku
-```
-
-By using `--include` option, you can use it in any order:
-
-```bash
-npx poku --include='targetePath'
-```
-
-```bash
-npx poku --include='targetePathA,targetePathB'
-```
-
-```bash
-npx poku --include='./'
-```
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/DOM.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/DOM.mdx
deleted file mode 100644
index 886b0a5c..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/DOM.mdx
+++ /dev/null
@@ -1,25 +0,0 @@
----
-sidebar_position: 3
----
-
-# Virtual DOM
-
-Let's simule a **Virtual DOM** (Browser) by using [**jsdom**](https://github.com/jsdom/jsdom), then testing its results with **Poku**:
-
-```ts
-import { assert } from 'poku';
-import { JSDOM } from 'jsdom';
-
-const dom = new JSDOM('Poku
');
-const document = dom.window.document;
-
-const name = document.querySelector('#name');
-
-assert.strictEqual(name?.textContent, 'Poku', 'My div contains a Poku 🐷');
-```
-
-Then:
-
-```bash
-npx poku
-```
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/cases/_category_.json b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/cases/_category_.json
deleted file mode 100644
index f7ce81ca..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/cases/_category_.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "label": "Use Cases",
- "collapsed": true,
- "link": {
- "type": "generated-index"
- }
-}
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/cases/compexy-no-exit.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/cases/compexy-no-exit.mdx
deleted file mode 100644
index 3735cc61..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/cases/compexy-no-exit.mdx
+++ /dev/null
@@ -1,76 +0,0 @@
-# A Complex Case
-
-**Imagine these steps to perform a test:**
-
-1. Perform **Unit Tests** suite in parallel
-2. Clear and Populate the Database
-3. Check for **Expected Successes Integration** suite sequentially
-4. Clear and Populate the Database — again
-5. Check for **Expected Failures Integration** suite sequentially
-
-**Requirements:**
-
-Each step requires success to be processed.
-
-**Directory Structure:**
-
-```bash
-├── .
-├── test
-│ ├── unit
-│ ├── integration
-│ │ ├── successes
-│ │ │ └── **/.spec.js
-│ │ └── failures
-│ │ └── **/.spec.js
-│ ├─ run.test.js # The runner
-│ ├─ tools.test.js
-```
-
-> Do we really need to complicate things even more by creating advanced tests runs to run our already complex tests? 😅
-
-### Poku's Solution ✨
-
-```ts
-import { poku, assert } from 'poku';
-import { recreateDatabase } from './tools.test.js';
-
-const unitCode = await poku('test/unit', {
- parallel: true,
- noExit: true,
-});
-
-assert.strictEqual(0, unitCode, 'Running Unit Tests');
-
-await assert.doesNotReject(
- recreateDatabase(),
- 'Preparing DB for Successes Integration Tests'
-);
-
-const successesCode = await poku('test/integration/successes', {
- noExit: true,
-});
-
-assert.strictEqual(0, successesCode, 'Running Successes Integration Tests');
-
-await assert.doesNotReject(
- recreateDatabase(),
- 'Preparing DB for Successes Integration Tests'
-);
-
-const failuresCode = await poku('test/integration/failures', {
- noExit: true,
-});
-
-assert.strictEqual(0, failuresCode, 'Running Failures Integration Tests');
-```
-
-> Why comment the code if we can do it better? 🧙🏻
-
-**Finally**
-
-```bash
-npx poku test/run.test.js
-```
-
-> Or `npx poku test/run.test.ts` for **TypeScript**.
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/cjs-esm.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/cjs-esm.mdx
deleted file mode 100644
index e9339793..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/cjs-esm.mdx
+++ /dev/null
@@ -1,32 +0,0 @@
----
-sidebar_position: 4
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-# CJS and ESM
-
-Just set your **package.json** as usual and that's it.
-**Poku** doesn't require any configuration 🐷
-
-
-
-
-```json
-{
- "type": "commonjs"
-}
-```
-
-
-
-
-```json
-{
- "type": "module"
-}
-```
-
-
-
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/mock/_category_.json b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/mock/_category_.json
deleted file mode 100644
index 71abb29d..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/mock/_category_.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "label": "Mock",
- "collapsed": true,
- "link": {
- "type": "generated-index"
- },
- "position": 2
-}
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/mock/cjs.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/mock/cjs.mdx
deleted file mode 100644
index 6f498499..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/mock/cjs.mdx
+++ /dev/null
@@ -1,64 +0,0 @@
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-# Mock using CJS
-
-You can use your favorite **Mock** framework or tool and **Poku** together 🐷➕
-
-For this example, let's use the [**quibble**](https://github.com/testdouble/quibble), then testing its results with **Poku**:
-
-
-
-
- ```js
- const { assert } = require('poku');
- const quibble = require('quibble');
-
- (async () => {
- await quibble('../lib/funds.js', {
- // Original: 100
- getFunds: () => 200,
- });
-
- const { withdraw } = require('../lib/withdraw.js');
-
- assert.strictEqual(withdraw(200), true, 'Mocking my funds to 200');
-
- assert.strictEqual(withdraw(300), false, "I can't get more than I have");
-
- await quibble.reset();
- })();
- ```
-
-
-
-
- ```js
- const getFunds = () => 100;
-
- module.exports = { getFunds };
- ```
-
-
-
-
- ```js
- const { getFunds } = require('./funds.js');
-
- const withdraw = (value) => {
- const wallet = getFunds();
-
- return value <= wallet;
- };
-
- module.exports = { withdraw };
- ```
-
-
-
-
-Then:
-
-```bash
-npx poku
-```
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/mock/esm.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/mock/esm.mdx
deleted file mode 100644
index fe0120f8..00000000
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/mock/esm.mdx
+++ /dev/null
@@ -1,58 +0,0 @@
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-# Mock using ESM
-
-You can use your favorite **Mock** framework or tool and **Poku** together 🐷➕
-
-For this example, let's use the [**quibble**](https://github.com/testdouble/quibble), then testing its results with **Poku**:
-
-
-
-
- ```js
- import { assert } from 'poku';
- import quibble from 'quibble';
-
- await quibble.esm('../lib/funds.js', {
- // Original: 100
- getFunds: () => 200,
- });
-
- const { withdraw } = await import('../lib/withdraw.test.js');
-
- assert.strictEqual(withdraw(200), true, 'Mocking my funds to 200');
-
- assert.strictEqual(withdraw(300), false, "I can't get more than I have");
-
- await quibble.reset();
- ```
-
-
-
-
- ```js
- export const getFunds = () => 100;
- ```
-
-
-
-
- ```js
- import { getFunds } from './funds.js';
-
- export const withdraw = (value) => {
- const wallet = getFunds();
-
- return value <= wallet;
- };
- ```
-
-
-
-
-Then:
-
-```bash
-npx poku
-```
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/index.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/index.mdx
index 0ea8074a..4f96db2e 100644
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/index.mdx
+++ b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/index.mdx
@@ -129,8 +129,7 @@ Você também pode usar o **Poku** via [**esm.sh**](https://esm.sh):
import { poku } from 'https://esm.sh/poku';
```
-
-
+
### **Teste** 🔬
@@ -147,6 +146,8 @@ assert(true, 'Poku irá descrever isso 🐷');
+> Note que os exemplos são baseados em [**ESM**](/docs/examples/cjs-esm), mas você pode usar [**CJS**](/docs/examples/cjs-esm) normalmente.
+
### **Execute** 🚀
@@ -185,9 +186,29 @@ deno run npm:poku
+## Métodos Disponíveis
+
+### Essenciais
+
+- `poku` (_test runner_)
+- `assert` e `assertPromise` (_testes de asserção_)
+- `startService` e `startScript` (_excecutar serviços em plano de fundo_)
+
+### Auxiliares
+
+- `test`
+- `beforeEach` e `afterEach`
+- `describe` e `log`
+- `listFiles`
+- `exit`
+
+[**Veja a documentação completa**](/docs/category/documentation).
+
+
+
## Documentação
-> Inicialmente, a [**documentação**](/docs/category/documentation) e [**exemplos**](/docs/category/examples) são baseados no **Node.js**, mas você pode usar tudo normalmente para **Bun** and **Deno**.
+> Inicialmente, a [**documentação**](/docs/category/documentation) e [**exemplos**](/docs/category/examples) são baseados no **Node.js** e **ESM**, mas você pode usar tudo normalmente para **Bun** e **Deno**, além do **CJS**.
@@ -226,21 +247,21 @@ Verifique o [**SECURITY.md**](https://github.com/wellwelwel/poku/blob/main/SECUR
style={{ textDecoration: 'none', color: 'inherit' }}
>
-## Autor
+## Author
@wellwelwel
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/overview.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/overview.mdx
index 20be5ce3..43432bce 100644
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/overview.mdx
+++ b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/overview.mdx
@@ -13,7 +13,7 @@ import ASSERT_NODE from '@site/static/img/assert-node.png';
| | |
- Por padrão, o **Poku**:
- - Procura por todos os arquivos _`.test.`_ e `.spec.`, mas você pode personalizar isso usando a opção [**`filter`**](/docs/documentation/poku/configs/filter).
+ - Procura por todos os arquivos _`.test.`_ e `.spec.`, mas você pode personalizar isso usando a opção [**`filter`**](/docs/documentation/poku/options/filter).
- Usa o modo `sequencial`.
- Você pode usar concorrência ao definir a opção `--parallel` no terminal ou definindo a opção `parallel` como `true` ao usar a **API** (_in-code_).
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/security.mdx b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/security.mdx
index be49ef12..422639e0 100644
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/security.mdx
+++ b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/security.mdx
@@ -15,7 +15,7 @@ Alguns _Test Runners_ usam **`eval`**, o **Poku** prefere usar o **`spawn`** par
- `\` para **Windows**
- `/` para **Linux** e **macOS**
- Normaliza os caminhos ao filtrar caractéres incomuns para caminhos, por exemplo:
- - `<>:|^?*`
+ - `<>|^?*`
- Previne _shell scripts_ ao definir `shell` como `false` no **`spawn`**, garantindo que apenas argumentos seguros serão usados.
- Cada **RegExp** é previamente testado usando o [**ReDoS Checker**](https://devina.io/redos-checker).
diff --git a/website/src/css/custom.scss b/website/src/css/custom.scss
index 8c69ed21..e03fc7f3 100644
--- a/website/src/css/custom.scss
+++ b/website/src/css/custom.scss
@@ -41,7 +41,7 @@
}
.theme-code-block-highlighted-line {
- opacity: 0.35;
+ opacity: 0.5;
font-style: italic;
font-size: 0.8rem;
background-color: unset !important;