poku 2.6.2 → 2.6.3-canary.0af5c8f
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/lib/bin/enforce.js +3 -0
- package/lib/bin/help.js +98 -0
- package/lib/bin/index.js +5 -0
- package/lib/configs/poku.d.ts +1 -0
- package/lib/configs/poku.js +3 -2
- package/lib/modules/essentials/strict.js +6 -5
- package/lib/modules/helpers/describe.d.ts +7 -5
- package/lib/modules/helpers/describe.js +14 -1
- package/lib/modules/helpers/it/core.d.ts +6 -1
- package/lib/modules/helpers/it/core.js +12 -1
- package/lib/modules/helpers/modifiers.d.ts +14 -6
- package/lib/modules/helpers/modifiers.js +25 -21
- package/lib/modules/helpers/test.d.ts +1 -0
- package/lib/parsers/get-arg.d.ts +3 -0
- package/lib/parsers/get-arg.js +4 -1
- package/lib/services/run-test-file.js +2 -1
- package/lib/services/run-tests.js +7 -0
- package/package.json +2 -2
package/lib/bin/enforce.js
CHANGED
|
@@ -14,15 +14,18 @@ const checkFlags = () => {
|
|
|
14
14
|
'--denoAllow',
|
|
15
15
|
'--denoCjs',
|
|
16
16
|
'--denoDeny',
|
|
17
|
+
'--describeOnly',
|
|
17
18
|
'--enforce',
|
|
18
19
|
'--envFile',
|
|
19
20
|
'--exclude',
|
|
20
21
|
'--failFast',
|
|
21
22
|
'--filter',
|
|
23
|
+
'--itOnly',
|
|
22
24
|
'--killPid',
|
|
23
25
|
'--killPort',
|
|
24
26
|
'--killRange',
|
|
25
27
|
'--node',
|
|
28
|
+
'--only',
|
|
26
29
|
'--parallel',
|
|
27
30
|
'--platform',
|
|
28
31
|
'--quiet',
|
package/lib/bin/help.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.help = void 0;
|
|
4
|
+
const format_js_1 = require("../services/format.js");
|
|
5
|
+
const write_js_1 = require("../services/write.js");
|
|
6
|
+
const b = (text) => `${(0, format_js_1.format)(text).bold()}`;
|
|
7
|
+
const i = (text) => `${(0, format_js_1.format)(text).italic()}`;
|
|
8
|
+
const u = (text) => `${(0, format_js_1.format)(text).underline()}`;
|
|
9
|
+
const d = (text) => `${(0, format_js_1.format)(text).dim()}`;
|
|
10
|
+
const options = i('[--options]');
|
|
11
|
+
const paths = i('[paths]');
|
|
12
|
+
const bullet = d('●');
|
|
13
|
+
const summary = [
|
|
14
|
+
['--bun', 'Enforce tests to run through Bun.'],
|
|
15
|
+
['--concurrency', 'Limit the number of tests running concurrently.'],
|
|
16
|
+
['--config, -c', 'Specify a configuration file.'],
|
|
17
|
+
['--debug, -d', 'Show detailed logs.'],
|
|
18
|
+
['--deno', 'Enforce tests to run through Deno.'],
|
|
19
|
+
['--denoAllow', 'Allow permissions for Deno.'],
|
|
20
|
+
['--denoCjs', 'Support CommonJS in Deno.'],
|
|
21
|
+
['--denoDeny', 'Deny permissions for Deno.'],
|
|
22
|
+
['--describeOnly', 'Only `describe` tests using `.only` will be run.'],
|
|
23
|
+
['--enforce, -x', 'Validate options before running tests.'],
|
|
24
|
+
['--envFile', 'Read and set an environment file.'],
|
|
25
|
+
['--exclude', 'Exclude by path using Regex to match files.'],
|
|
26
|
+
['--failFast', 'Stop tests at the first failure.'],
|
|
27
|
+
['--filter', 'Filter by path using Regex to match files.'],
|
|
28
|
+
['--help, -h', "Show Poku's CLI basic usage."],
|
|
29
|
+
['--itOnly', 'Only `it` and `test` tests using `.only` will be run.'],
|
|
30
|
+
['--killPid', 'Terminate the specified processes.'],
|
|
31
|
+
['--killPort', 'Terminate the specified ports.'],
|
|
32
|
+
['--killRange', 'Terminate the specified port ranges.'],
|
|
33
|
+
['--listFiles', 'Display all the files returned in the terminal.'],
|
|
34
|
+
['--node', 'Enforce tests to run through Node.js.'],
|
|
35
|
+
['--only', 'Only tests using `.only` will be run.'],
|
|
36
|
+
['--parallel, -p', 'Run tests files in parallel.'],
|
|
37
|
+
['--platform', 'Enforce tests to run through a platform.'],
|
|
38
|
+
['--quiet, -q', 'Run tests with no logs.'],
|
|
39
|
+
['--testOnly', 'Only `it` and `test` tests using `.only` will be run.'],
|
|
40
|
+
['--version, -v', "Show Poku's installed version."],
|
|
41
|
+
['--watch, -w', 'Watch for test events.'],
|
|
42
|
+
['--watchInterval', 'Set an interval for watch events.'],
|
|
43
|
+
];
|
|
44
|
+
const sortedSummary = summary.sort(([a], [b]) => a.localeCompare(b));
|
|
45
|
+
const largeEndPad = (() => Math.max(...summary.map(([start]) => start.length)))();
|
|
46
|
+
const header = `
|
|
47
|
+
🐷 ${(0, format_js_1.format)(' Poku — CLI Usage ').bg('brightMagenta')}
|
|
48
|
+
|
|
49
|
+
› ${u(b('Usage:'))}
|
|
50
|
+
|
|
51
|
+
poku ${options} ${paths}
|
|
52
|
+
poku ${paths} ${options}
|
|
53
|
+
|
|
54
|
+
› ${u(b('Ensuring platforms:'))}
|
|
55
|
+
|
|
56
|
+
poku ${b('--node')} ${options} ${paths}
|
|
57
|
+
poku ${b('--bun')} ${options} ${paths}
|
|
58
|
+
poku ${b('--deno')} ${options} ${paths}
|
|
59
|
+
|
|
60
|
+
› ${u(b('Tips:'))}
|
|
61
|
+
|
|
62
|
+
${bullet} All CLI options use camel case pattern (e.g.: ${b('--failFast')}).
|
|
63
|
+
${bullet} Use ${b('=')} to set an option value (e.g.: ${b('--concurrency=4')}).
|
|
64
|
+
${bullet} If you're seeing this, ${u('feel special')} ✨
|
|
65
|
+
`;
|
|
66
|
+
const main = `
|
|
67
|
+
🐽 ${(0, format_js_1.format)(' Poku — Options ').bg('brightMagenta')}
|
|
68
|
+
|
|
69
|
+
› ${u(b('Summary:'))}
|
|
70
|
+
|
|
71
|
+
${sortedSummary
|
|
72
|
+
.map(([command, description]) => `${command.padEnd(largeEndPad)} ${d(description)}`)
|
|
73
|
+
.join('\n')}
|
|
74
|
+
|
|
75
|
+
› ${u(b('Notes:'))}
|
|
76
|
+
|
|
77
|
+
${bullet} For Glob support, see:
|
|
78
|
+
${u('https://poku.io/docs/documentation/poku/include-files#by-extending-glob-patterns-from-shell')}
|
|
79
|
+
|
|
80
|
+
${bullet} Avoid conflicts for environments with multiple platforms:
|
|
81
|
+
${u('https://poku.io/docs/tutorials/cross-platform')}
|
|
82
|
+
`;
|
|
83
|
+
const footer = `
|
|
84
|
+
${b('Documentation:')} ${u('https://poku.io')}
|
|
85
|
+
|
|
86
|
+
${bullet} ${b('Poku')} is made with ${b('love')} and ${b('care')} in every detail.
|
|
87
|
+
${bullet} Give him a ${b('star')} to show your support 🌟
|
|
88
|
+
`;
|
|
89
|
+
const help = () => {
|
|
90
|
+
write_js_1.Write.hr();
|
|
91
|
+
write_js_1.Write.log(header.trim());
|
|
92
|
+
write_js_1.Write.hr();
|
|
93
|
+
write_js_1.Write.log(main.trim());
|
|
94
|
+
write_js_1.Write.hr();
|
|
95
|
+
write_js_1.Write.log(footer.trim());
|
|
96
|
+
write_js_1.Write.hr();
|
|
97
|
+
};
|
|
98
|
+
exports.help = help;
|
package/lib/bin/index.js
CHANGED
|
@@ -18,6 +18,11 @@ const options_js_1 = require("../parsers/options.js");
|
|
|
18
18
|
write_js_1.Write.log(VERSION);
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
+
if ((0, get_arg_js_1.hasArg)('help') || (0, get_arg_js_1.hasArg)('h', '-')) {
|
|
22
|
+
const { help } = require('./help.js');
|
|
23
|
+
help();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
21
26
|
const enforce = (0, get_arg_js_1.hasArg)('enforce') || (0, get_arg_js_1.hasArg)('x', '-');
|
|
22
27
|
const configFile = (0, get_arg_js_1.getArg)('config') || (0, get_arg_js_1.getArg)('c', '-');
|
|
23
28
|
const defaultConfigs = await (0, options_js_1.getConfigs)(configFile);
|
package/lib/configs/poku.d.ts
CHANGED
package/lib/configs/poku.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VERSION = exports.results = void 0;
|
|
3
|
+
exports.deepOptions = exports.VERSION = exports.results = void 0;
|
|
4
4
|
exports.results = {
|
|
5
5
|
success: 0,
|
|
6
6
|
fail: 0,
|
|
7
7
|
skip: 0,
|
|
8
8
|
todo: 0,
|
|
9
9
|
};
|
|
10
|
-
exports.VERSION = '2.6.
|
|
10
|
+
exports.VERSION = '2.6.3-canary.0af5c8f';
|
|
11
|
+
exports.deepOptions = [];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.strict = void 0;
|
|
7
|
-
const strict_1 = __importDefault(require("assert/strict"));
|
|
8
4
|
const assert_js_1 = require("../../builders/assert.js");
|
|
9
|
-
|
|
5
|
+
const get_runtime_js_1 = require("../../parsers/get-runtime.js");
|
|
6
|
+
|
|
7
|
+
const nodeAssert = !get_runtime_js_1.nodeVersion || get_runtime_js_1.nodeVersion >= 16
|
|
8
|
+
? require("assert/strict")
|
|
9
|
+
: require("assert");
|
|
10
|
+
exports.strict = (0, assert_js_1.createAssert)(nodeAssert);
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { DescribeOptions } from '../../@types/describe.js';
|
|
2
|
-
import { todo, skip } from './modifiers.js';
|
|
3
|
-
declare function
|
|
4
|
-
declare function describeCore(
|
|
2
|
+
import { todo, skip, onlyDescribe } from './modifiers.js';
|
|
3
|
+
export declare function describeBase(arg1: string | (() => unknown | Promise<unknown>), arg2?: (() => unknown | Promise<unknown>) | DescribeOptions): Promise<void>;
|
|
4
|
+
declare function describeCore(message: string, cb: () => Promise<unknown>): Promise<void>;
|
|
5
|
+
declare function describeCore(message: string, cb: () => unknown): void;
|
|
5
6
|
declare function describeCore(cb: () => Promise<unknown>): Promise<void>;
|
|
6
|
-
declare function describeCore(cb: () => unknown):
|
|
7
|
-
declare function describeCore(
|
|
7
|
+
declare function describeCore(cb: () => unknown): void;
|
|
8
|
+
declare function describeCore(message: string, options?: DescribeOptions): void;
|
|
8
9
|
export declare const describe: typeof describeCore & {
|
|
9
10
|
todo: typeof todo;
|
|
10
11
|
skip: typeof skip;
|
|
12
|
+
only: typeof onlyDescribe;
|
|
11
13
|
};
|
|
12
14
|
export {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.describe = void 0;
|
|
4
|
+
exports.describeBase = describeBase;
|
|
4
5
|
const node_process_1 = require("process");
|
|
5
6
|
const format_js_1 = require("../../services/format.js");
|
|
6
7
|
const write_js_1 = require("../../services/write.js");
|
|
7
8
|
const indentation_js_1 = require("../../configs/indentation.js");
|
|
8
9
|
const modifiers_js_1 = require("./modifiers.js");
|
|
9
|
-
|
|
10
|
+
const get_arg_js_1 = require("../../parsers/get-arg.js");
|
|
11
|
+
async function describeBase(arg1, arg2) {
|
|
10
12
|
let title;
|
|
11
13
|
let cb;
|
|
12
14
|
let options;
|
|
@@ -46,7 +48,18 @@ async function describeCore(arg1, arg2) {
|
|
|
46
48
|
indentation_js_1.indentation.hasDescribe = false;
|
|
47
49
|
write_js_1.Write.log(`${(0, format_js_1.format)(`● ${title}`).success().bold()} ${(0, format_js_1.format)(`› ${total}ms`).success().dim()}`);
|
|
48
50
|
}
|
|
51
|
+
async function describeCore(messageOrCb, cbOrOptions) {
|
|
52
|
+
if (typeof messageOrCb === 'string' && typeof cbOrOptions !== 'function')
|
|
53
|
+
return describeBase(messageOrCb, cbOrOptions);
|
|
54
|
+
if (get_arg_js_1.hasOnly || get_arg_js_1.hasDescribeOnly)
|
|
55
|
+
return;
|
|
56
|
+
if (typeof messageOrCb === 'string' && typeof cbOrOptions === 'function')
|
|
57
|
+
return describeBase(messageOrCb, cbOrOptions);
|
|
58
|
+
if (typeof messageOrCb === 'function')
|
|
59
|
+
return describeBase(messageOrCb);
|
|
60
|
+
}
|
|
49
61
|
exports.describe = Object.assign(describeCore, {
|
|
50
62
|
todo: modifiers_js_1.todo,
|
|
51
63
|
skip: modifiers_js_1.skip,
|
|
64
|
+
only: modifiers_js_1.onlyDescribe,
|
|
52
65
|
});
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { todo, skip } from '../modifiers.js';
|
|
1
|
+
import { todo, skip, onlyIt } from '../modifiers.js';
|
|
2
|
+
export declare function itBase(...args: [
|
|
3
|
+
string | (() => unknown | Promise<unknown>),
|
|
4
|
+
(() => unknown | Promise<unknown>)?
|
|
5
|
+
]): Promise<void>;
|
|
2
6
|
declare function itCore(message: string, cb: () => Promise<unknown>): Promise<void>;
|
|
3
7
|
declare function itCore(message: string, cb: () => unknown): void;
|
|
4
8
|
declare function itCore(cb: () => Promise<unknown>): Promise<void>;
|
|
@@ -6,5 +10,6 @@ declare function itCore(cb: () => unknown): void;
|
|
|
6
10
|
export declare const it: typeof itCore & {
|
|
7
11
|
todo: typeof todo;
|
|
8
12
|
skip: typeof skip;
|
|
13
|
+
only: typeof onlyIt;
|
|
9
14
|
};
|
|
10
15
|
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.it = void 0;
|
|
4
|
+
exports.itBase = itBase;
|
|
4
5
|
const node_process_1 = require("process");
|
|
5
6
|
const each_js_1 = require("../../../configs/each.js");
|
|
6
7
|
const indentation_js_1 = require("../../../configs/indentation.js");
|
|
7
8
|
const format_js_1 = require("../../../services/format.js");
|
|
8
9
|
const write_js_1 = require("../../../services/write.js");
|
|
9
10
|
const modifiers_js_1 = require("../modifiers.js");
|
|
10
|
-
|
|
11
|
+
const get_arg_js_1 = require("../../../parsers/get-arg.js");
|
|
12
|
+
async function itBase(...args) {
|
|
11
13
|
try {
|
|
12
14
|
let message;
|
|
13
15
|
let cb;
|
|
@@ -56,7 +58,16 @@ async function itCore(...args) {
|
|
|
56
58
|
throw error;
|
|
57
59
|
}
|
|
58
60
|
}
|
|
61
|
+
async function itCore(messageOrCb, cb) {
|
|
62
|
+
if (get_arg_js_1.hasOnly || get_arg_js_1.hasItOnly)
|
|
63
|
+
return;
|
|
64
|
+
if (typeof messageOrCb === 'string' && cb)
|
|
65
|
+
return itBase(messageOrCb, cb);
|
|
66
|
+
if (typeof messageOrCb === 'function')
|
|
67
|
+
return itBase(messageOrCb);
|
|
68
|
+
}
|
|
59
69
|
exports.it = Object.assign(itCore, {
|
|
60
70
|
todo: modifiers_js_1.todo,
|
|
61
71
|
skip: modifiers_js_1.skip,
|
|
72
|
+
only: modifiers_js_1.onlyIt,
|
|
62
73
|
});
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
export declare function todo(message: string): void;
|
|
2
|
-
export declare function todo(message: string,
|
|
3
|
-
export declare function todo(message: string,
|
|
4
|
-
export declare function skip(message: string,
|
|
5
|
-
export declare function skip(message: string,
|
|
6
|
-
export declare function skip(
|
|
7
|
-
export declare function skip(
|
|
2
|
+
export declare function todo(message: string, cb?: () => Promise<unknown>): Promise<void>;
|
|
3
|
+
export declare function todo(message: string, cb?: () => unknown): void;
|
|
4
|
+
export declare function skip(message: string, cb: () => Promise<unknown>): Promise<void>;
|
|
5
|
+
export declare function skip(message: string, cb: () => unknown): void;
|
|
6
|
+
export declare function skip(cb: () => Promise<unknown>): Promise<void>;
|
|
7
|
+
export declare function skip(cb: () => unknown): void;
|
|
8
|
+
export declare function onlyDescribe(message: string, cb: () => Promise<unknown>): Promise<void>;
|
|
9
|
+
export declare function onlyDescribe(message: string, cb: () => unknown): void;
|
|
10
|
+
export declare function onlyDescribe(cb: () => Promise<unknown>): Promise<void>;
|
|
11
|
+
export declare function onlyDescribe(cb: () => unknown): void;
|
|
12
|
+
export declare function onlyIt(message: string, cb: () => Promise<unknown>): Promise<void>;
|
|
13
|
+
export declare function onlyIt(message: string, cb: () => unknown): void;
|
|
14
|
+
export declare function onlyIt(cb: () => Promise<unknown>): Promise<void>;
|
|
15
|
+
export declare function onlyIt(cb: () => unknown): void;
|
|
@@ -2,35 +2,39 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.todo = todo;
|
|
4
4
|
exports.skip = skip;
|
|
5
|
+
exports.onlyDescribe = onlyDescribe;
|
|
6
|
+
exports.onlyIt = onlyIt;
|
|
5
7
|
const write_js_1 = require("../../services/write.js");
|
|
6
8
|
const indentation_js_1 = require("../../configs/indentation.js");
|
|
7
9
|
const format_js_1 = require("../../services/format.js");
|
|
10
|
+
const core_js_1 = require("./it/core.js");
|
|
11
|
+
const describe_js_1 = require("./describe.js");
|
|
12
|
+
const get_arg_js_1 = require("../../parsers/get-arg.js");
|
|
13
|
+
const node_process_1 = require("process");
|
|
8
14
|
async function todo(message, _cb) {
|
|
9
15
|
write_js_1.Write.log(`${indentation_js_1.indentation.hasDescribe ? ' ' : ''}${(0, format_js_1.format)(`● ${message}`).cyan().bold()}`);
|
|
10
|
-
|
|
11
|
-
if (typeof _cb === 'function') {
|
|
12
|
-
const isAsync = _cb.constructor.name === 'AsyncFunction';
|
|
13
|
-
if (isAsync)
|
|
14
|
-
return await Promise.resolve();
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
16
|
}
|
|
19
17
|
async function skip(messageOrCb, _cb) {
|
|
20
|
-
const message =
|
|
18
|
+
const message = typeof messageOrCb === 'string' ? messageOrCb : 'Skipping';
|
|
21
19
|
write_js_1.Write.log(`${indentation_js_1.indentation.hasDescribe ? ' ' : ''}${(0, format_js_1.format)(`◯ ${message}`).info().bold()}`);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return;
|
|
20
|
+
}
|
|
21
|
+
async function onlyDescribe(messageOrCb, cb) {
|
|
22
|
+
if (!(get_arg_js_1.hasOnly || get_arg_js_1.hasDescribeOnly)) {
|
|
23
|
+
write_js_1.Write.log((0, format_js_1.format)("Can't run `describe.only` tests without `--only` or `--describeOnly` flags").fail());
|
|
24
|
+
(0, node_process_1.exit)(1);
|
|
28
25
|
}
|
|
29
|
-
if (typeof
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
if (typeof messageOrCb === 'string' && cb)
|
|
27
|
+
return (0, describe_js_1.describeBase)(messageOrCb, cb);
|
|
28
|
+
if (typeof messageOrCb === 'function')
|
|
29
|
+
return (0, describe_js_1.describeBase)(messageOrCb);
|
|
30
|
+
}
|
|
31
|
+
async function onlyIt(messageOrCb, cb) {
|
|
32
|
+
if (!(get_arg_js_1.hasOnly || get_arg_js_1.hasItOnly)) {
|
|
33
|
+
write_js_1.Write.log((0, format_js_1.format)("Can't run `it.only` and `test.only` tests without `--only`, `--itOnly` or `--testOnly` flags").fail());
|
|
34
|
+
(0, node_process_1.exit)(1);
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
+
if (typeof messageOrCb === 'string' && cb)
|
|
37
|
+
return (0, core_js_1.itBase)(messageOrCb, cb);
|
|
38
|
+
if (typeof messageOrCb === 'function')
|
|
39
|
+
return (0, core_js_1.itBase)(messageOrCb);
|
|
36
40
|
}
|
package/lib/parsers/get-arg.d.ts
CHANGED
|
@@ -2,3 +2,6 @@ export declare const getArg: (arg: string, prefix?: string, baseArgs?: string[])
|
|
|
2
2
|
export declare const hasArg: (arg: string, prefix?: string, baseArgs?: string[]) => boolean;
|
|
3
3
|
export declare const getPaths: (prefix?: string, baseArgs?: string[]) => string[] | undefined;
|
|
4
4
|
export declare const argToArray: (arg: string, prefix?: string, baseArgs?: string[]) => string[] | undefined;
|
|
5
|
+
export declare const hasOnly: boolean;
|
|
6
|
+
export declare const hasItOnly: boolean;
|
|
7
|
+
export declare const hasDescribeOnly: boolean;
|
package/lib/parsers/get-arg.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.argToArray = exports.getPaths = exports.hasArg = exports.getArg = void 0;
|
|
3
|
+
exports.hasDescribeOnly = exports.hasItOnly = exports.hasOnly = exports.argToArray = exports.getPaths = exports.hasArg = exports.getArg = void 0;
|
|
4
4
|
const node_process_1 = require("process");
|
|
5
5
|
const to_dynamic_case_js_1 = require("./to-dynamic-case.js");
|
|
6
6
|
const [, , ...processArgs] = node_process_1.argv;
|
|
@@ -43,3 +43,6 @@ const argToArray = (arg, prefix = '--', baseArgs = processedArgs) => {
|
|
|
43
43
|
.filter((a) => a);
|
|
44
44
|
};
|
|
45
45
|
exports.argToArray = argToArray;
|
|
46
|
+
exports.hasOnly = (0, exports.hasArg)('only');
|
|
47
|
+
exports.hasItOnly = (0, exports.hasArg)('itonly') || (0, exports.hasArg)('testonly');
|
|
48
|
+
exports.hasDescribeOnly = (0, exports.hasArg)('describeonly');
|
|
@@ -11,6 +11,7 @@ const format_js_1 = require("./format.js");
|
|
|
11
11
|
const output_js_1 = require("../parsers/output.js");
|
|
12
12
|
const each_js_1 = require("./each.js");
|
|
13
13
|
const write_js_1 = require("./write.js");
|
|
14
|
+
const poku_js_1 = require("../configs/poku.js");
|
|
14
15
|
const cwd = (0, node_process_1.cwd)();
|
|
15
16
|
const runTestFile = async (filePath, configs) => {
|
|
16
17
|
var _a, _b;
|
|
@@ -41,7 +42,7 @@ const runTestFile = async (filePath, configs) => {
|
|
|
41
42
|
return false;
|
|
42
43
|
return new Promise((resolve) => {
|
|
43
44
|
var _a;
|
|
44
|
-
const child = (0, node_child_process_1.spawn)(runtime, runtimeArguments, {
|
|
45
|
+
const child = (0, node_child_process_1.spawn)(runtime, [...runtimeArguments, ...poku_js_1.deepOptions], {
|
|
45
46
|
stdio: ['inherit', 'pipe', 'pipe'],
|
|
46
47
|
shell: get_runner_js_1.isWindows,
|
|
47
48
|
env: {
|
|
@@ -15,7 +15,14 @@ const run_test_file_js_1 = require("./run-test-file.js");
|
|
|
15
15
|
const output_js_1 = require("../parsers/output.js");
|
|
16
16
|
const poku_js_1 = require("../configs/poku.js");
|
|
17
17
|
const os_js_1 = require("../polyfills/os.js");
|
|
18
|
+
const get_arg_js_1 = require("../parsers/get-arg.js");
|
|
18
19
|
const cwd = node_process_1.default.cwd();
|
|
20
|
+
if (get_arg_js_1.hasOnly)
|
|
21
|
+
poku_js_1.deepOptions.push('--only');
|
|
22
|
+
if (get_arg_js_1.hasDescribeOnly)
|
|
23
|
+
poku_js_1.deepOptions.push('--describeOnly');
|
|
24
|
+
if (get_arg_js_1.hasItOnly)
|
|
25
|
+
poku_js_1.deepOptions.push('--itOnly');
|
|
19
26
|
const runTests = async (dir, configs) => {
|
|
20
27
|
const testDir = (0, node_path_1.join)(cwd, dir);
|
|
21
28
|
const currentDir = (0, node_path_1.relative)(cwd, testDir);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poku",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3-canary.0af5c8f",
|
|
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",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"packages-update": "^2.0.0",
|
|
65
65
|
"prettier": "^3.3.3",
|
|
66
66
|
"tsx": "4.19.0",
|
|
67
|
-
"typescript": "^5.
|
|
67
|
+
"typescript": "^5.6.2"
|
|
68
68
|
},
|
|
69
69
|
"keywords": [
|
|
70
70
|
"🐷",
|