poku 3.0.2 → 3.0.3-canary.4b9d2ac2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -17
- package/lib/@types/poku.d.ts +1 -1
- package/lib/bin/index.js +37 -6
- package/lib/bin/watch.js +1 -1
- package/lib/builders/assert.d.ts +2 -2
- package/lib/configs/poku.js +2 -2
- package/lib/modules/essentials/assert.d.ts +1 -1
- package/lib/modules/essentials/assert.js +1 -1
- package/lib/modules/essentials/poku.js +2 -2
- package/lib/modules/essentials/strict.js +5 -7
- package/lib/modules/helpers/create-service.js +3 -3
- package/lib/modules/helpers/describe.js +1 -1
- package/lib/modules/helpers/env.js +2 -2
- package/lib/modules/helpers/exit.js +2 -2
- package/lib/modules/helpers/it/core.js +1 -1
- package/lib/modules/helpers/list-files.js +3 -3
- package/lib/modules/helpers/modifiers.js +1 -1
- package/lib/modules/helpers/skip.js +1 -1
- package/lib/modules/helpers/wait-for.js +2 -2
- package/lib/parsers/get-arg.js +1 -1
- package/lib/parsers/get-runner.js +1 -1
- package/lib/parsers/get-runtime.js +2 -2
- package/lib/parsers/options.js +36 -3
- package/lib/parsers/os.js +1 -1
- package/lib/parsers/runtime-version.js +1 -1
- package/lib/polyfills/os.js +1 -1
- package/lib/services/assert.js +2 -2
- package/lib/services/container.js +1 -1
- package/lib/services/enforce.js +2 -2
- package/lib/services/map-tests.js +2 -2
- package/lib/services/pid.js +1 -1
- package/lib/services/reporters/dot.js +1 -1
- package/lib/services/reporters/poku.js +2 -2
- package/lib/services/run-test-file.js +3 -3
- package/lib/services/run-tests.js +2 -2
- package/lib/services/watch.js +3 -3
- package/lib/services/write.js +1 -1
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -18,13 +18,6 @@ Enjoying **Poku**? Give him a star to show your support 🌟
|
|
|
18
18
|
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
|
-
> [!IMPORTANT]
|
|
22
|
-
>
|
|
23
|
-
> **Poku `v3`** is here! 🎉
|
|
24
|
-
>
|
|
25
|
-
> - To check out what's changed, follow the [**Issue #801**](https://github.com/wellwelwel/poku/issues/801).
|
|
26
|
-
> - For `v2` documentation, see the [**previous version's documentation**](https://poku.io/docs/2.x.x) and [**README**](https://github.com/wellwelwel/poku/tree/2.x.x?tab=readme-ov-file#readme).<br />
|
|
27
|
-
|
|
28
21
|
---
|
|
29
22
|
|
|
30
23
|
## Why does Poku exist?
|
|
@@ -245,12 +238,15 @@ To see the detailed documentation, please visit the [**Documentation**](https://
|
|
|
245
238
|
|
|
246
239
|
---
|
|
247
240
|
|
|
248
|
-
### Common Issues
|
|
241
|
+
### Common Issues (FAQ)
|
|
249
242
|
|
|
250
243
|
- [Avoiding conflicts in environments with multiple platforms installed](https://poku.io/docs/tutorials/cross-platform#recommendations).
|
|
251
244
|
- [Properly running asynchronous tests on the same file](https://poku.io/docs/examples/promises).
|
|
252
|
-
- [Using **Poku** without installing on **Deno**
|
|
253
|
-
-
|
|
245
|
+
- [Using **Poku** without installing it on **Deno**](https://github.com/wellwelwel/poku/discussions/565).
|
|
246
|
+
- Migrating:
|
|
247
|
+
- [From version **3.x.x** to version **4.x.x**](https://github.com/wellwelwel/poku/issues/1006).
|
|
248
|
+
- [From version **2.x.x** to version **3.x.x**](https://github.com/wellwelwel/poku/issues/801).
|
|
249
|
+
- [From version **1.x.x** to version **2.x.x**](https://github.com/wellwelwel/poku/issues/533).
|
|
254
250
|
|
|
255
251
|
---
|
|
256
252
|
|
|
@@ -260,9 +256,11 @@ To see the detailed documentation, please visit the [**Documentation**](https://
|
|
|
260
256
|
|
|
261
257
|
**Poku** is [continuously tested](https://github.com/wellwelwel/poku/blob/main/.github/workflows/ci_benchmark.yml) to ensure the following expectations for basic usage:
|
|
262
258
|
|
|
263
|
-
- ~**4x** faster than [**Jest**](https://github.com/jestjs/jest) (
|
|
264
|
-
- ~**
|
|
265
|
-
- ~**1x**
|
|
259
|
+
- ~**4x** faster than [**Jest**](https://github.com/jestjs/jest) (30.0.5)
|
|
260
|
+
- ~**5x** faster than [**Vitest**](https://github.com/vitest-dev/vitest) (v3.2.4)
|
|
261
|
+
- ~**1x** _faster_ than [**Mocha**](https://github.com/mochajs/mocha) (v11.7.1) — _even with test file isolation_ 🚀
|
|
262
|
+
|
|
263
|
+
All comparisons are rounded down (e.g., `4.99` would be rounded down to `~4x`).
|
|
266
264
|
|
|
267
265
|
> - You can see how the tests are run and compared in the [benchmark](https://github.com/wellwelwel/poku/tree/main/benchmark) directory.
|
|
268
266
|
> - [Comparing **Poku** and native test runners _(discussion)_](https://github.com/wellwelwel/poku/discussions/740).
|
|
@@ -273,9 +271,9 @@ To see the detailed documentation, please visit the [**Documentation**](https://
|
|
|
273
271
|
|
|
274
272
|
[](https://pkg-size.dev/poku)
|
|
275
273
|
|
|
276
|
-
- [~**
|
|
277
|
-
- [~**
|
|
278
|
-
- [~**
|
|
274
|
+
- [~**206x** lighter than **Vitest**](https://pkg-size.dev/vitest@3.2.4)
|
|
275
|
+
- [~**165x** lighter than **Jest**](https://pkg-size.dev/jest@30.0.5)
|
|
276
|
+
- [~**52x** lighter than **Mocha**](https://pkg-size.dev/mocha@11.7.1)
|
|
279
277
|
|
|
280
278
|
> **Poku** size ensures _cost-saving_ **CI** for services that charge for storage and usage.
|
|
281
279
|
|
|
@@ -297,10 +295,20 @@ See the [**Contributing Guide**](https://github.com/wellwelwel/poku/blob/main/CO
|
|
|
297
295
|
|
|
298
296
|
## Acknowledgements
|
|
299
297
|
|
|
300
|
-
|
|
298
|
+
### Contributors
|
|
299
|
+
|
|
300
|
+
My thanks to everyone who has dedicated their time and effort to improving **Poku**.
|
|
301
301
|
|
|
302
302
|
[](https://opencollective.com/poku/contributors.svg?button=false)
|
|
303
303
|
|
|
304
|
+
### Sponsors
|
|
305
|
+
|
|
306
|
+
Really thanks to everyone who has supported and keeps supporting my work.
|
|
307
|
+
|
|
308
|
+
> _Also for the private ones, who don't appear here_ 🕵
|
|
309
|
+
|
|
310
|
+
[](https://github.com/sponsors/wellwelwel)
|
|
311
|
+
|
|
304
312
|
---
|
|
305
313
|
|
|
306
314
|
## License
|
package/lib/@types/poku.d.ts
CHANGED
package/lib/bin/index.js
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
37
|
const poku_js_1 = require("../configs/poku.js");
|
|
5
38
|
const poku_js_2 = require("../modules/essentials/poku.js");
|
|
@@ -17,7 +50,7 @@ const write_js_1 = require("../services/write.js");
|
|
|
17
50
|
return;
|
|
18
51
|
}
|
|
19
52
|
if ((0, get_arg_js_1.hasArg)('help') || (0, get_arg_js_1.hasArg)('h', '-')) {
|
|
20
|
-
require('./help.js').help();
|
|
53
|
+
(await Promise.resolve().then(() => __importStar(require('./help.js')))).help();
|
|
21
54
|
return;
|
|
22
55
|
}
|
|
23
56
|
const enforce = (0, get_arg_js_1.hasArg)('enforce') || (0, get_arg_js_1.hasArg)('x', '-');
|
|
@@ -60,7 +93,7 @@ const write_js_1 = require("../services/write.js");
|
|
|
60
93
|
if (dirs.length === 1)
|
|
61
94
|
poku_js_1.states.isSinglePath = true;
|
|
62
95
|
if ((0, get_arg_js_1.hasArg)('listFiles')) {
|
|
63
|
-
const { listFiles } = require('../modules/helpers/list-files.js');
|
|
96
|
+
const { listFiles } = await Promise.resolve().then(() => __importStar(require('../modules/helpers/list-files.js')));
|
|
64
97
|
const files = [];
|
|
65
98
|
(0, write_js_1.hr)();
|
|
66
99
|
for (const dir of dirs)
|
|
@@ -105,8 +138,7 @@ const write_js_1 = require("../services/write.js");
|
|
|
105
138
|
poku_js_1.GLOBAL.envFile = (0, get_arg_js_1.getArg)('envFile') ?? configsFromFile?.envFile ?? '.env';
|
|
106
139
|
}
|
|
107
140
|
if (enforce)
|
|
108
|
-
require('../services/enforce.js').enforce();
|
|
109
|
-
|
|
141
|
+
(await Promise.resolve().then(() => __importStar(require('../services/enforce.js')))).enforce();
|
|
110
142
|
if (killPort || configsFromFile?.kill?.port) {
|
|
111
143
|
const ports = killPort?.split(',').map(Number) || configsFromFile?.kill?.port || [];
|
|
112
144
|
tasks.push(kill_js_1.kill.port(ports));
|
|
@@ -126,7 +158,6 @@ const write_js_1 = require("../services/write.js");
|
|
|
126
158
|
const PIDs = killPID?.split(',').map(Number) || configsFromFile?.kill?.pid || [];
|
|
127
159
|
tasks.push(kill_js_1.kill.pid(PIDs));
|
|
128
160
|
}
|
|
129
|
-
|
|
130
161
|
poku_js_1.GLOBAL.envFile && tasks.push((0, env_js_1.envFile)(poku_js_1.GLOBAL.envFile));
|
|
131
162
|
if (debug || configsFromFile?.debug) {
|
|
132
163
|
(0, write_js_1.hr)();
|
|
@@ -142,5 +173,5 @@ const write_js_1 = require("../services/write.js");
|
|
|
142
173
|
await (0, poku_js_2.poku)(dirs);
|
|
143
174
|
|
|
144
175
|
if (watchMode)
|
|
145
|
-
|
|
176
|
+
require('./watch.js').startWatch(dirs);
|
|
146
177
|
})();
|
package/lib/bin/watch.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.startWatch = void 0;
|
|
7
|
-
const node_process_1 = __importDefault(require("process"));
|
|
7
|
+
const node_process_1 = __importDefault(require("node:process"));
|
|
8
8
|
const poku_js_1 = require("../configs/poku.js");
|
|
9
9
|
const poku_js_2 = require("../modules/essentials/poku.js");
|
|
10
10
|
const get_arg_js_1 = require("../parsers/get-arg.js");
|
package/lib/builders/assert.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type assert from
|
|
2
|
-
import type { AssertPredicate } from
|
|
1
|
+
import type assert from 'node:assert';
|
|
2
|
+
import type { AssertPredicate } from 'node:assert';
|
|
3
3
|
import type { ProcessAssertionOptions } from '../@types/assert.js';
|
|
4
4
|
export declare const createAssert: (nodeAssert: typeof assert) => ((value: unknown, message?: ProcessAssertionOptions["message"]) => void) & {
|
|
5
5
|
ok: (value: unknown, message?: ProcessAssertionOptions["message"]) => void;
|
package/lib/configs/poku.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GLOBAL = exports.deepOptions = exports.VERSION = exports.results = exports.timespan = exports.states = void 0;
|
|
4
|
-
const node_process_1 = require("process");
|
|
4
|
+
const node_process_1 = require("node:process");
|
|
5
5
|
const get_runtime_js_1 = require("../parsers/get-runtime.js");
|
|
6
6
|
const reporter_js_1 = require("../services/reporter.js");
|
|
7
7
|
exports.states = Object.create(null);
|
|
@@ -12,7 +12,7 @@ exports.results = {
|
|
|
12
12
|
skipped: 0,
|
|
13
13
|
todo: 0,
|
|
14
14
|
};
|
|
15
|
-
exports.VERSION = '3.0.
|
|
15
|
+
exports.VERSION = '3.0.3-canary.4b9d2ac2';
|
|
16
16
|
exports.deepOptions = [];
|
|
17
17
|
exports.GLOBAL = {
|
|
18
18
|
cwd: (0, node_process_1.cwd)(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import nodeAssert from
|
|
1
|
+
import nodeAssert from 'node:assert';
|
|
2
2
|
export declare const assert: ((value: unknown, message?: import("../../@types/assert.js").ProcessAssertionOptions["message"]) => void) & {
|
|
3
3
|
ok: (value: unknown, message?: import("../../@types/assert.js").ProcessAssertionOptions["message"]) => void;
|
|
4
4
|
equal: (actual: unknown, expected: unknown, message?: import("../../@types/assert.js").ProcessAssertionOptions["message"]) => void;
|
|
@@ -4,6 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.assert = void 0;
|
|
7
|
-
const node_assert_1 = __importDefault(require("assert"));
|
|
7
|
+
const node_assert_1 = __importDefault(require("node:assert"));
|
|
8
8
|
const assert_js_1 = require("../../builders/assert.js");
|
|
9
9
|
exports.assert = (0, assert_js_1.createAssert)(node_assert_1.default);
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.onSigint = void 0;
|
|
7
7
|
exports.poku = poku;
|
|
8
|
-
const node_path_1 = require("path");
|
|
9
|
-
const node_process_1 = __importDefault(require("process"));
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
|
+
const node_process_1 = __importDefault(require("node:process"));
|
|
10
10
|
const poku_js_1 = require("../../configs/poku.js");
|
|
11
11
|
const reporter_js_1 = require("../../services/reporter.js");
|
|
12
12
|
const run_tests_js_1 = require("../../services/run-tests.js");
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.strict = void 0;
|
|
7
|
+
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
4
8
|
const assert_js_1 = require("../../builders/assert.js");
|
|
5
|
-
|
|
6
|
-
const runtime_version_js_1 = require("../../parsers/runtime-version.js");
|
|
7
|
-
|
|
8
|
-
const nodeAssert = poku_js_1.GLOBAL.runtime !== 'node' || runtime_version_js_1.runtimeVersion >= 16
|
|
9
|
-
? require("assert/strict")
|
|
10
|
-
: require("assert");
|
|
11
|
-
exports.strict = (0, assert_js_1.createAssert)(nodeAssert);
|
|
9
|
+
exports.strict = (0, assert_js_1.createAssert)(strict_1.default);
|
|
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.startScript = exports.startService = void 0;
|
|
7
|
-
const node_child_process_1 = require("child_process");
|
|
8
|
-
const node_path_1 = require("path");
|
|
9
|
-
const node_process_1 = __importDefault(require("process"));
|
|
7
|
+
const node_child_process_1 = require("node:child_process");
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
|
+
const node_process_1 = __importDefault(require("node:process"));
|
|
10
10
|
const get_runner_js_1 = require("../../parsers/get-runner.js");
|
|
11
11
|
const os_js_1 = require("../../parsers/os.js");
|
|
12
12
|
const write_js_1 = require("../../services/write.js");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.describe = void 0;
|
|
4
4
|
exports.describeBase = describeBase;
|
|
5
|
-
const node_process_1 = require("process");
|
|
5
|
+
const node_process_1 = require("node:process");
|
|
6
6
|
const poku_js_1 = require("../../configs/poku.js");
|
|
7
7
|
const callback_js_1 = require("../../parsers/callback.js");
|
|
8
8
|
const get_arg_js_1 = require("../../parsers/get-arg.js");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.envFile = void 0;
|
|
4
|
-
const promises_1 = require("fs/promises");
|
|
5
|
-
const node_process_1 = require("process");
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_process_1 = require("node:process");
|
|
6
6
|
const env_js_1 = require("../../services/env.js");
|
|
7
7
|
const list_files_js_1 = require("./list-files.js");
|
|
8
8
|
const regex = {
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.exit = void 0;
|
|
7
|
-
const node_assert_1 = require("assert");
|
|
8
|
-
const node_process_1 = __importDefault(require("process"));
|
|
7
|
+
const node_assert_1 = require("node:assert");
|
|
8
|
+
const node_process_1 = __importDefault(require("node:process"));
|
|
9
9
|
const poku_js_1 = require("../../configs/poku.js");
|
|
10
10
|
const exit = (code, quiet) => {
|
|
11
11
|
const isPoku = poku_js_1.results.passed > 0 || poku_js_1.results.failed > 0;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.it = void 0;
|
|
4
4
|
exports.itBase = itBase;
|
|
5
|
-
const node_process_1 = require("process");
|
|
5
|
+
const node_process_1 = require("node:process");
|
|
6
6
|
const each_js_1 = require("../../../configs/each.js");
|
|
7
7
|
const indentation_js_1 = require("../../../configs/indentation.js");
|
|
8
8
|
const poku_js_1 = require("../../../configs/poku.js");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.listFiles = exports.getAllFiles = exports.escapeRegExp = exports.isFile = exports.sanitizePath = void 0;
|
|
4
|
-
const promises_1 = require("fs/promises");
|
|
5
|
-
const node_path_1 = require("path");
|
|
6
|
-
const node_process_1 = require("process");
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const node_process_1 = require("node:process");
|
|
7
7
|
const poku_js_1 = require("../../configs/poku.js");
|
|
8
8
|
const regex = {
|
|
9
9
|
sep: /[/\\]+/g,
|
|
@@ -4,7 +4,7 @@ exports.todo = todo;
|
|
|
4
4
|
exports.skip = skip;
|
|
5
5
|
exports.onlyDescribe = onlyDescribe;
|
|
6
6
|
exports.onlyIt = onlyIt;
|
|
7
|
-
const node_process_1 = require("process");
|
|
7
|
+
const node_process_1 = require("node:process");
|
|
8
8
|
const poku_js_1 = require("../../configs/poku.js");
|
|
9
9
|
const callback_js_1 = require("../../parsers/callback.js");
|
|
10
10
|
const get_arg_js_1 = require("../../parsers/get-arg.js");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.skip = void 0;
|
|
4
|
-
const node_process_1 = require("process");
|
|
4
|
+
const node_process_1 = require("node:process");
|
|
5
5
|
const poku_js_1 = require("../../configs/poku.js");
|
|
6
6
|
const skip = (message = 'Skipping') => {
|
|
7
7
|
if (message)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.waitForPort = exports.waitForExpectedResult = exports.sleep = void 0;
|
|
4
|
-
const node_assert_1 = require("assert");
|
|
5
|
-
const node_net_1 = require("net");
|
|
4
|
+
const node_assert_1 = require("node:assert");
|
|
5
|
+
const node_net_1 = require("node:net");
|
|
6
6
|
const checkPort = (port, host) => new Promise((resolve) => {
|
|
7
7
|
const client = (0, node_net_1.createConnection)(port, host);
|
|
8
8
|
client.on('connect', () => {
|
package/lib/parsers/get-arg.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.hasOnly = exports.argToArray = exports.getPaths = exports.hasArg = exports.getArg = void 0;
|
|
4
|
-
const node_process_1 = require("process");
|
|
4
|
+
const node_process_1 = require("node:process");
|
|
5
5
|
const [, , ...processArgs] = node_process_1.argv;
|
|
6
6
|
const regexQuotes = /''|""/;
|
|
7
7
|
const getArg = (arg, prefix = '--', baseArgs = processArgs) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.scriptRunner = exports.runner = void 0;
|
|
4
|
-
const node_path_1 = require("path");
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
5
|
const poku_js_1 = require("../configs/poku.js");
|
|
6
6
|
const os_js_1 = require("./os.js");
|
|
7
7
|
const runner = (filename) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRuntime = void 0;
|
|
4
|
-
const node_path_1 = require("path");
|
|
5
|
-
const node_process_1 = require("process");
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const node_process_1 = require("node:process");
|
|
6
6
|
const getRuntime = () => {
|
|
7
7
|
const { _, POKU_RUNTIME } = node_process_1.env;
|
|
8
8
|
if (POKU_RUNTIME)
|
package/lib/parsers/options.js
CHANGED
|
@@ -1,8 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.getConfigs = void 0;
|
|
4
|
-
const promises_1 = require("fs/promises");
|
|
5
|
-
const node_path_1 = require("path");
|
|
37
|
+
const promises_1 = require("node:fs/promises");
|
|
38
|
+
const node_path_1 = require("node:path");
|
|
6
39
|
const poku_js_1 = require("../configs/poku.js");
|
|
7
40
|
const jsonc_js_1 = require("../polyfills/jsonc.js");
|
|
8
41
|
const os_js_1 = require("./os.js");
|
|
@@ -23,7 +56,7 @@ const getConfigs = async (customPath) => {
|
|
|
23
56
|
path += (0, node_path_1.normalize)(filePath);
|
|
24
57
|
try {
|
|
25
58
|
if (filePath.endsWith('.js') || filePath.endsWith('.cjs'))
|
|
26
|
-
return
|
|
59
|
+
return await Promise.resolve(`${path}`).then(s => __importStar(require(s)));
|
|
27
60
|
const configsFile = await (0, promises_1.readFile)(filePath, 'utf8');
|
|
28
61
|
return jsonc_js_1.JSONC.parse(configsFile);
|
|
29
62
|
}
|
package/lib/parsers/os.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runtimeVersion = void 0;
|
|
4
|
-
const node_process_1 = require("process");
|
|
4
|
+
const node_process_1 = require("node:process");
|
|
5
5
|
const poku_js_1 = require("../configs/poku.js");
|
|
6
6
|
exports.runtimeVersion = (() => {
|
|
7
7
|
if (poku_js_1.GLOBAL.runtime === 'bun')
|
package/lib/polyfills/os.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.availableParallelism = void 0;
|
|
4
|
-
const node_os_1 = require("os");
|
|
4
|
+
const node_os_1 = require("node:os");
|
|
5
5
|
const availableParallelism = () => typeof node_os_1.availableParallelism === 'function'
|
|
6
6
|
? (0, node_os_1.availableParallelism)()
|
|
7
7
|
: ((0, node_os_1.cpus)()?.length ?? 0);
|
package/lib/services/assert.js
CHANGED
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.processAsyncAssert = exports.processAssert = void 0;
|
|
8
|
-
const node_assert_1 = require("assert");
|
|
9
|
-
const node_process_1 = __importDefault(require("process"));
|
|
8
|
+
const node_assert_1 = require("node:assert");
|
|
9
|
+
const node_process_1 = __importDefault(require("node:process"));
|
|
10
10
|
const poku_js_1 = require("../configs/poku.js");
|
|
11
11
|
const assertProcessor = () => {
|
|
12
12
|
const { isPoku, reporter } = poku_js_1.GLOBAL;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DockerCompose = exports.DockerContainer = void 0;
|
|
4
|
-
const node_child_process_1 = require("child_process");
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
5
|
const list_files_js_1 = require("../modules/helpers/list-files.js");
|
|
6
6
|
const os_js_1 = require("../parsers/os.js");
|
|
7
7
|
const write_js_1 = require("../services/write.js");
|
package/lib/services/enforce.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.enforce = void 0;
|
|
4
|
-
const promises_1 = require("fs/promises");
|
|
5
|
-
const node_process_1 = require("process");
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_process_1 = require("node:process");
|
|
6
6
|
const poku_js_1 = require("../configs/poku.js");
|
|
7
7
|
const get_arg_js_1 = require("../parsers/get-arg.js");
|
|
8
8
|
const format_js_1 = require("./format.js");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapTests = exports.createImportMap = exports.processDeepImports = exports.findMatchingFiles = exports.getDeepImports = exports.normalizePath = void 0;
|
|
4
|
-
const promises_1 = require("fs/promises");
|
|
5
|
-
const node_path_1 = require("path");
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
6
|
const list_files_js_1 = require("../modules/helpers/list-files.js");
|
|
7
7
|
const importMap = new Map();
|
|
8
8
|
const processedFiles = new Set();
|
package/lib/services/pid.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getPIDs = exports.killPID = exports.populateRange = exports.setPortsAndPIDs = void 0;
|
|
4
|
-
const node_child_process_1 = require("child_process");
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
5
|
const regex = {
|
|
6
6
|
sequentialSpaces: /\s+/,
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dot = void 0;
|
|
4
|
-
const node_process_1 = require("process");
|
|
4
|
+
const node_process_1 = require("node:process");
|
|
5
5
|
const reporter_js_1 = require("../../builders/reporter.js");
|
|
6
6
|
const format_js_1 = require("../format.js");
|
|
7
7
|
const write_js_1 = require("../write.js");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.poku = exports.errors = void 0;
|
|
4
|
-
const node_path_1 = require("path");
|
|
5
|
-
const node_process_1 = require("process");
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const node_process_1 = require("node:process");
|
|
6
6
|
const indentation_js_1 = require("../../configs/indentation.js");
|
|
7
7
|
const poku_js_1 = require("../../configs/poku.js");
|
|
8
8
|
const assert_js_1 = require("../../parsers/assert.js");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runTestFile = void 0;
|
|
4
|
-
const node_child_process_1 = require("child_process");
|
|
5
|
-
const node_path_1 = require("path");
|
|
6
|
-
const node_process_1 = require("process");
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const node_process_1 = require("node:process");
|
|
7
7
|
const poku_js_1 = require("../configs/poku.js");
|
|
8
8
|
const get_runner_js_1 = require("../parsers/get-runner.js");
|
|
9
9
|
const os_js_1 = require("../parsers/os.js");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runTests = void 0;
|
|
4
|
-
const node_path_1 = require("path");
|
|
5
|
-
const node_process_1 = require("process");
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const node_process_1 = require("node:process");
|
|
6
6
|
const poku_js_1 = require("../configs/poku.js");
|
|
7
7
|
const get_arg_js_1 = require("../parsers/get-arg.js");
|
|
8
8
|
const os_js_1 = require("../polyfills/os.js");
|
package/lib/services/watch.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.watch = exports.Watcher = void 0;
|
|
4
|
-
const node_fs_1 = require("fs");
|
|
5
|
-
const promises_1 = require("fs/promises");
|
|
6
|
-
const node_path_1 = require("path");
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const promises_1 = require("node:fs/promises");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
7
|
const list_files_js_1 = require("../modules/helpers/list-files.js");
|
|
8
8
|
class Watcher {
|
|
9
9
|
constructor(rootDir, callback) {
|
package/lib/services/write.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.hr = exports.log = void 0;
|
|
4
|
-
const node_process_1 = require("process");
|
|
4
|
+
const node_process_1 = require("node:process");
|
|
5
5
|
const columns = Math.max((node_process_1.stdout.columns || 50) - 10, 40);
|
|
6
6
|
const log = (data) => node_process_1.stdout.write(`${String(data)}\n`);
|
|
7
7
|
exports.log = log;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poku",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3-canary.4b9d2ac2",
|
|
4
4
|
"description": "🐷 Poku makes testing easy for Node.js, Bun, Deno, and you at the same time.",
|
|
5
5
|
"main": "./lib/modules/index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"lib"
|
|
25
25
|
],
|
|
26
26
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
27
|
+
"node": ">=16.x.x",
|
|
28
28
|
"bun": ">=1.x.x",
|
|
29
29
|
"deno": ">=1.x.x",
|
|
30
30
|
"typescript": ">=5.x.x"
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"test": "tsx src/bin/index.ts test/unit test/integration test/e2e",
|
|
34
34
|
"test:bun": "bun src/bin/index.ts test/unit test/integration test/e2e",
|
|
35
35
|
"test:deno": "deno run -A src/bin/index.ts --denoAllow=all test/unit test/integration test/e2e",
|
|
36
|
-
"pretest:
|
|
37
|
-
"test:
|
|
38
|
-
"posttest:
|
|
36
|
+
"pretest:coverage": "tsx tools/build/c8-file.ts",
|
|
37
|
+
"test:coverage": "c8 --experimental-monocart npm test",
|
|
38
|
+
"posttest:coverage": "rm -rf ./.nycrc.json",
|
|
39
39
|
"test:docker:node": "bun test/ci.test.ts",
|
|
40
40
|
"clear": "rm -rf lib ci coverage .temp test-src test-tests",
|
|
41
41
|
"prebuild": "npm run clear",
|
|
42
42
|
"build": "tsc && cd test && tsc",
|
|
43
|
-
"postbuild": "tsx tools/compatibility/
|
|
43
|
+
"postbuild": "tsx tools/compatibility/comments.ts && tsx tools/build/version.ts && cp test/__fixtures__/e2e/server/package.json ci/test/__fixtures__/e2e/server/package.json && rm -f ./lib/@types/*.js ./lib/bin/*.ts && npm run build:deno && chmod +x lib/bin/index.js",
|
|
44
44
|
"build:deno": "tsc -p tsconfig.mjs.json",
|
|
45
45
|
"postbuild:deno": "tsx tools/build/check-deno-polyfill.ts",
|
|
46
46
|
"lint": "biome lint --error-on-warnings && prettier --check .",
|
|
@@ -51,15 +51,15 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@biomejs/biome": "1.9.4",
|
|
54
|
-
"@ianvs/prettier-plugin-sort-imports": "^4.
|
|
55
|
-
"@types/node": "^22.
|
|
54
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.5.1",
|
|
55
|
+
"@types/node": "^22.16.5",
|
|
56
56
|
"c8": "^10.1.3",
|
|
57
57
|
"jsonc.min": "^1.1.0",
|
|
58
|
-
"monocart-coverage-reports": "^2.12.
|
|
58
|
+
"monocart-coverage-reports": "^2.12.6",
|
|
59
59
|
"packages-update": "^2.0.0",
|
|
60
|
-
"prettier": "^3.
|
|
61
|
-
"tsx": "4.
|
|
62
|
-
"typescript": "^5.8.
|
|
60
|
+
"prettier": "^3.6.2",
|
|
61
|
+
"tsx": "4.20.3",
|
|
62
|
+
"typescript": "^5.8.3"
|
|
63
63
|
},
|
|
64
64
|
"keywords": [
|
|
65
65
|
"🐷",
|