@zohodesk/unit-testing-framework 0.0.11-experimental → 0.0.13-experimental
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.
|
@@ -22,6 +22,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
22
22
|
* @property {string} [projectRoot] - Absolute path to the consumer project (default: cwd).
|
|
23
23
|
* @property {boolean} [coverage] - Enable coverage collection.
|
|
24
24
|
* @property {string[]} [testFiles] - Specific test file patterns to run.
|
|
25
|
+
* @property {string} [testPathPattern] - Regex pattern to match test file paths (e.g. 'myFile.test.js').
|
|
25
26
|
* @property {boolean} [verbose] - Verbose output.
|
|
26
27
|
* @property {number|string} [maxWorkers] - Worker concurrency (e.g. '50%' or 4).
|
|
27
28
|
* @property {boolean} [silent] - Suppress console output from tests.
|
|
@@ -39,6 +40,7 @@ async function createJestRunner(options = {}) {
|
|
|
39
40
|
projectRoot = process.cwd(),
|
|
40
41
|
coverage,
|
|
41
42
|
testFiles,
|
|
43
|
+
testPathPattern,
|
|
42
44
|
verbose,
|
|
43
45
|
maxWorkers,
|
|
44
46
|
silent,
|
|
@@ -61,6 +63,7 @@ async function createJestRunner(options = {}) {
|
|
|
61
63
|
// runCLI expects a yargs-like argv object.
|
|
62
64
|
const argv = buildArgv(mergedConfig, {
|
|
63
65
|
testFiles,
|
|
66
|
+
testPathPattern,
|
|
64
67
|
watch,
|
|
65
68
|
projectRoot
|
|
66
69
|
});
|
|
@@ -84,12 +87,14 @@ async function createJestRunner(options = {}) {
|
|
|
84
87
|
* @param {object} config - Merged Jest config.
|
|
85
88
|
* @param {object} extra
|
|
86
89
|
* @param {string[]} [extra.testFiles]
|
|
90
|
+
* @param {string} [extra.testPathPattern]
|
|
87
91
|
* @param {boolean} [extra.watch]
|
|
88
92
|
* @param {string} extra.projectRoot
|
|
89
93
|
* @returns {object}
|
|
90
94
|
*/
|
|
91
95
|
function buildArgv(config, {
|
|
92
96
|
testFiles,
|
|
97
|
+
testPathPattern,
|
|
93
98
|
watch,
|
|
94
99
|
projectRoot
|
|
95
100
|
}) {
|
|
@@ -113,5 +118,11 @@ function buildArgv(config, {
|
|
|
113
118
|
_: testFiles ?? [],
|
|
114
119
|
$0: 'unit-testing-framework'
|
|
115
120
|
};
|
|
121
|
+
|
|
122
|
+
// If a specific test file/pattern is provided, use testPathPattern
|
|
123
|
+
// so Jest only runs matching test files.
|
|
124
|
+
if (testPathPattern) {
|
|
125
|
+
argv.testPathPattern = testPathPattern;
|
|
126
|
+
}
|
|
116
127
|
return argv;
|
|
117
128
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/unit-testing-framework",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13-experimental",
|
|
4
4
|
"description": "A modular Jest-based unit testing framework",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -34,9 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/cli": "7.28.6",
|
|
37
|
-
"@babel/core": "7.29.0",
|
|
38
37
|
"@babel/plugin-transform-modules-commonjs": "7.28.6",
|
|
39
|
-
"@babel/preset-env": "7.29.0",
|
|
40
38
|
"jest": "30.2.0"
|
|
41
39
|
}
|
|
42
40
|
}
|